Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Bulk Insert failing

Author  Topic 

ch9862
Yak Posting Veteran

76 Posts

Posted - 2012-03-22 : 08:33:04
I have an SSIS package BULK INSERTing data from flat file into a view. This has been working fine until recently. Now I see the following error in the logs:
quote:
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 1

The only recent change I can think of is that some of the fields in the underlying table have been lengthened. Types have not changed - only instead of nvarchar(50) there is nvarchar(150), etc. Column 1 mentioned in the error message is the same (int).
Could this change be the reason for the issue? And if so - what do I ask our DBA to do to fix it? Delete and recreate the view?

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-22 : 09:49:34
can you see the data? open in notepad?

I ALWAYS load my data to a staging table where the columns are varchar(max)...then do data audits


Post the DDL of your table and the first several rows of data if you can

My guess is that the first column is datetime and it's a bad date




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

ch9862
Yak Posting Veteran

76 Posts

Posted - 2012-03-23 : 09:40:13
quote:
Originally posted by X002548
can you see the data? open in notepad?

Thanks for your help.
In our case, the data arrives as XML, and the SSIS package verifies it, transforms to text and does bulk insert. Something went wrong with the stylesheets and the files were encoded as ASCII instead of Unicode. Took me a while to figure it out, I was focusing on the text itself .

quote:
Originally posted by X002548
I ALWAYS load my data to a staging table where the columns are varchar(max)...then do data audits
I wish it was the case here, but our client's data analysts won't let us. They require for all the data types and sizes to be the same in staging tables as they are in the tables downastream.
We're yet to have a production issue as a result, but testers upstream sometimes enter very long data directly in the exported XML, and we have to explain bulk insert failures in ST environment. Shrug.

Thanks again!


Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-23 : 11:02:43
Did you mean

>> Our Client's Data A__ Holes

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -