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 12»»

Importing a file getting Error: The column delimiter for column "MyColumn" was not found. Expand / Collapse
Author
Message
Posted Friday, March 26, 2010 7:43 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 23, 2014 12:32 PM
Points: 177, Visits: 550
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.
Post #890624
Posted Friday, March 26, 2010 11:10 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 23, 2014 12:32 PM
Points: 177, Visits: 550
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.
Post #890890
Posted Friday, March 26, 2010 11:38 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, March 23, 2014 11:46 AM
Points: 87, Visits: 155
I've done a lot of this the last few weeks. Can you send me a sample file?
Post #890926
Posted Friday, March 26, 2010 11:42 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:34 PM
Points: 7,040, Visits: 12,966
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
Post #890929
Posted Friday, March 26, 2010 12:13 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 23, 2014 12:32 PM
Points: 177, Visits: 550
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...


  Post Attachments 
Sample30K.txt (17 views, 1.31 MB)
Post #890967
Posted Friday, March 26, 2010 12:43 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, March 23, 2014 11:46 AM
Points: 87, 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.
Post #890999
Posted Friday, March 26, 2010 12:52 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, June 23, 2014 12:32 PM
Points: 177, Visits: 550
would you have any sample script to get me started preferrably in VB -- I can muddle through C# if not.

Thanks,
Post #891003
Posted Friday, March 26, 2010 1:05 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 7:38 AM
Points: 1,669, Visits: 3,348
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

Post #891015
Posted Friday, March 26, 2010 1:10 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, March 23, 2014 11:46 AM
Points: 87, Visits: 155
Yes.

  Post Attachments 
CSV Import Problem Help.doc (105 views, 83.00 KB)
Post #891018
Posted Wednesday, March 31, 2010 5:27 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, March 23, 2014 11:46 AM
Points: 87, Visits: 155
Well, did you fix it?
Post #893652
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse