SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Importing a file getting Error: The column delimiter for column "MyColumn" was not found.


Importing a file getting Error: The column delimiter for column "MyColumn" was not found.

Author
Message
Mark F-428640
Mark F-428640
Old Hand
Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)

Group: General Forum Members
Points: 356 Visits: 557
I am getting an error importing a csv file both using SSIS and SSMS. The csv is comma delimited with quotes for text qualifiers. The file gets partially loaded and then gives me an error stating The column delimiter for column "MyColumn" was not found. In SSIS it gives me the data row which is apparently causing the problem but when I look at the file in a text editor at the specific row identified the file has the comma delimeter and it looks fine. Any ideas out there. By the way I am using SQL Server 2008.
Mark F-428640
Mark F-428640
Old Hand
Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)

Group: General Forum Members
Points: 356 Visits: 557
Ok I can see a lot of you are having a look but no one appears to have an answer for this. I have tried all I can think of. Can anyone suggest a way around the problem i.e. a way to ignore the offending row(s) of data. I have attempted to move the loading data on error to an error file but I am unable to get the data to be pushed to the error file. My thinking this is because the error does not fall in the category of allowable error for funnelling this way (although I thought it would funnel any error this way).

Another note my associate at work was able to load the file using SQL 2000 but it appeared to ignore 300k out of 14 million records on the load. I am assuming those rows are offending rows of data. Looking for any suggestions here this is getting frustrating.

Thanks in advance.
nano2nd
nano2nd
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 155
I've done a lot of this the last few weeks. Can you send me a sample file?
LutzM
LutzM
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10609 Visits: 13559
Without seeing two rows (one that passed and one that failed) it's almost impossible to say what's causing the error...



Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Mark F-428640
Mark F-428640
Old Hand
Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)

Group: General Forum Members
Points: 356 Visits: 557
Ok guys here is my sample file -- it has about 30k records in it -- the original file has 14 million. The offending column is ValueStr.

Appreciate the extra eyes...
Attachments
Sample30K.txt (189 views, 1.00 MB)
nano2nd
nano2nd
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 155
I've found a couple of problems so far. The package I put together first fails at Row 1682. If you suck the txt file into Excel you can see what is in row 1682 (search for Trames in the text file): it's empty when you look at it in Excel because all it has in it is three commas, which are delimiters. If I take that row out, the package runs further, down to row 1807 which only has one field in it. I could take that out and I'm sure it would run further. You may have to use a script task to scrub the data for you. I ran into a problem like this. I had a text file that some times had x columns in it, sometimes Y. I wrote a script to determine which type of file I had then use code to parse the variables out.
Mark F-428640
Mark F-428640
Old Hand
Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)Old Hand (356 reputation)

Group: General Forum Members
Points: 356 Visits: 557
would you have any sample script to get me started preferrably in VB -- I can muddle through C# if not.

Thanks,
gmby
gmby
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2366 Visits: 3792
We've had all kinds of trouble with text delimiters when importing to SQL2005. From our past experience if the text delimiter is in the column it just needs to be doubled up - but SSIS and import wizard trip up on it. After googling around we discovered it is a known bug or feature <grin>. And our understanding is that this has NOT been changed in SQL2008.

We do not allowed import files to be sent to us with text qualifiers anymore. We usually have OK luck with a multi-character column delimiter like #~

others have discovered the same issue...
http://www.sqlmag.com/community/Forums/tabid/426/aff/80/aft/69713/afv/topic/Default.aspx

not sure if this is your problem, but beware of those text delimiters in SQL2005 or SQL2008...

jg
nano2nd
nano2nd
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 155
Yes.
Attachments
CSV Import Problem Help.doc (320 views, 83.00 KB)
nano2nd
nano2nd
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 155
Well, did you fix it?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search