March 26, 2010 at 7:43 am
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.
March 26, 2010 at 11:10 am
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.
March 26, 2010 at 11:38 am
I've done a lot of this the last few weeks. Can you send me a sample file?
March 26, 2010 at 11:42 am
Without seeing two rows (one that passed and one that failed) it's almost impossible to say what's causing the error...
March 26, 2010 at 12:13 pm
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...
March 26, 2010 at 12:43 pm
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.
March 26, 2010 at 12:52 pm
would you have any sample script to get me started preferrably in VB -- I can muddle through C# if not.
Thanks,
March 26, 2010 at 1:05 pm
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
March 26, 2010 at 1:10 pm
Yes.
March 31, 2010 at 5:27 am
Well, did you fix it?
April 1, 2010 at 6:44 am
I'm using Bulk Insert. It seems that it ignores row delimiters, unless the row has all of the columns present. Is this working as designed? In other words, if the table I'm inputting into as 10 columns, and my text file has only 5 columns present (ending in a row delimiter) it puts the 5 columns, plus five columns from the next row.
*******************
What I lack in youth, I make up for in immaturity!
April 7, 2010 at 12:04 pm
Sorry -- I got a bit behind in my response -- (able to respond now due to server being down). No I have not resolved the issue yet and I probably won't be able to revisit it until finishing some othe "High" priority item. Appreciate the assistance I will post again once I resolve or if I need more assistance -- Thanks,
February 12, 2015 at 12:26 am
It means that some LF of CRLF or some text code is missed in your Flat file...Check your flat file is with correct format or not...
Change CR , LF , CRLF in Row Delimeter under Columns tab of Connection Manager...
it will give more info
January 2, 2016 at 6:29 am
I caught this error while attempting to import a CSV which I had created from a (much larger) CSV. I trimmed a 5GB CSV down to the 125,000 or so rows I needed, using WriteLine(). THE PROBLEM WAS WRITELINE()! Not sure if anyone will run into this - wanted to put it out there in case. WriteLine(string) adds both a carriage return (\r) and a line feed () to the CSV file. It took a while to figure out that having BOTH of these will throw the "column delimiter not found" error.
I changed my c# script to sw.Write(line + ""); This writes the lines with only the line feed at the end of each line.
Apologies if this is redundant. Took me a while to figure out and wanted to let people know.
Having trouble getting (forward slash "n") to show up in this post. I truly am a newbie. Changed my c# script to sw.Write(line+ "(forward slash)(n)");
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply