Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I import data from a TSV file with SQL Server 2008.

null is replaced by 0 when I confirm a table after import with integer column.

How to import as null, please Help me!!

share|improve this question
you mean csv??? – Nick Kavadias Jul 7 '09 at 5:57
TSV = Tab Separated Values. – mrdenny Jul 7 '09 at 6:09
What technique are you using to import the file? BCP, Bulk Insert, SSIS? – mrdenny Jul 7 '09 at 6:10
derrrr.. i knew that ! – Nick Kavadias Jul 7 '09 at 7:12
up vote 2 down vote accepted

IF you are using a BULK INSERT, did you specify the KEEPNULLS parameter?

BULK INSERT MyTestDefaultCol2
FROM 'C:\importin.txt'
  DATAFILETYPE = 'char',


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.