Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

conversion error Expand / Collapse
Author
Message
Posted Saturday, August 30, 2008 11:01 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 16, 2009 6:05 AM
Points: 39, Visits: 99
Hi Every Body

i am using ssis to import csv files into sql server with change data types.for that i taken one flat file source and transform the data using data conversion transformation and load the data into sql server.but it got the below error.


Note:in sql server destination i create one table.in that i taken int data type to Inintcode column.

InintCode(csv file) i want in destination(sql server)
--------- ------------------------
1.50E+11 150000000000
1.50E+11 150000000000
no data(empty) Null
6.00E+11 600000000000
6.00E+11 600000000000
1.42E+11 142000000000
1.42E+11 142000000000
no data(empty) Null
1.42E+11 142000000000
1.50E+11 150000000000


Error: 0xC02020C5 at Data Flow Task, Data Conversion [231]: Data conversion failed while converting column "Inintcode" (48) to column "Inintcode1" (581). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

Error: 0xC0209029 at Data Flow Task, Data Conversion [231]: The "output column "InintCode1" (581)" failed because error code 0xC020907F occurred, and the error row disposition on "output column "InintCode1" (581)" specifies failure on error. An error occurred on the specified object of the specified component.

Error: 0xC0047022 at Data Flow Task, DTS.Pipeline: The ProcessInput method on component "Data Conversion" (231) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0209029.

Thanks
murali
Post #561637
Posted Saturday, August 30, 2008 4:14 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:11 PM
Points: 35,769, Visits: 32,432
Heh... do you think that 150,000,000,000 is gonna fit in an INT in SQL Server? ;)

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #561675
Posted Sunday, August 31, 2008 12:55 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 16, 2009 6:05 AM
Points: 39, Visits: 99
Hi Jeff,

when i fit Int datatype it shows error.tell me which data type i have to fit here.
the problem is blank row(empty row).how to take the data into sql server with
null instead of blank row.

thanks
murali
Post #561734
Posted Sunday, August 31, 2008 9:33 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:11 PM
Points: 35,769, Visits: 32,432
muralikrishna37 (8/31/2008)
Hi Jeff,

when i fit Int datatype it shows error.tell me which data type i have to fit here.
the problem is blank row(empty row).how to take the data into sql server with
null instead of blank row.

thanks
murali


You need to use the BIGINT datatype. Recommend you lookup BIGINT in Books Online to see what it is and, possibly, lookup the other datatypes and read about them, as well. Datatypes are almost as important as the data itself.

So far as bringing in NULL's instead of blanks, I know virtually nothing about DTS or SSIS because I don't use them... I do use BCP and BULK INSERT extensively. Nulls will only occur if the data has two delimiters adjacent to each other with nothing inbetween. The -k parameter may help in that area but no guarantee's because I've not used it either. The reason is that I never import directly into a final table... too big a risk for too many reasons. I always import to staging tables and process from there. It's actually a pretty good habit to get into.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #561768
Posted Tuesday, September 2, 2008 4:54 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, June 25, 2009 11:35 AM
Points: 61, Visits: 112
Use a BIGINT Data Type as destination and try it

Regards
Venkat
http://sqlblogging.blogspot.com
Post #562752
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse