[dba-SQLServer] The strangest thing 00

Gustav Brock gustav at cactus.dk
Wed May 23 13:25:42 CDT 2012

Hi John

Yes, just as you think you have seen everything, then this.
Probably bad programming of the export, because what purpose could a leading 00 serve?


>>> jwcolby at colbyconsulting.com 23-05-12 19:44 >>>
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

More information about the dba-SQLServer mailing list