[dba-SQLServer] The strangest thing 00

jwcolby jwcolby at colbyconsulting.com
Wed May 23 12:44:09 CDT 2012


I just ran into the strangest problem.  I am importing CSV files into SQL Server manually (using the 
import wizard)  All is working or so it seems.  Suddenly I run into a set of files where the first 
column is missing.  The field exists, the column name exists, but the data is not being imported. 
Looking at a preview of the data in the wizard shows it there.

Looking *very carefully* at the text file using Ultra Edit shows the first line of actual data 
pushed over by a character.  Looking at the data in ASCII in Untra Edit shows a 00 in front of the 
opening ".  00 is an unprintable character and is a Null.  IOW each line of these files start with a 
NULL, except for the first (field names).

Stripping all of these nulls out leaves the file importing correctly.

Odd that the preview for the import wizard ignored the null but the actual import code did not.

-- 
John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it



More information about the dba-SQLServer mailing list