April 11, 2011 at 9:30 am
KEEPNULLS will keep any NULL value as in what would be in column C here ... "A,B,,D"
But your data has a value, and that value is the word "NULL".
I do believe, you'll either need to pull in your data as varchar, change NULL to 0 or actually set to NULL, or intercept/modify the input data before importing.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 11, 2011 at 9:31 am
i think the issue is BULK INSERT cannot differentiate between a string between two commas and the keyword NULL;
I'm not sure how to tackle that, other than putting it into a temporary table and importing from that based on a case statement.
SomeValue,1,OtherValue --expected int value
SomeValue,,OtherValue --would make the second value in the set NULL,
SomeValue,Null,OtherValue --assumes it's a string
Lowell
April 11, 2011 at 9:36 am
Ah, didn't think about my value being the WORD null.
April 11, 2011 at 9:39 am
can you pre-process the file by replacing Null with String.Empty? then you could continue using bulk insert
Lowell
Viewing 4 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply