Groups | Blog | Home
all groups > sql server (alternate) > july 2004 >

sql server (alternate) : BCP -k option - Very urgent


ganesh.kaliaperumal NO[at]SPAM wipro.com
7/13/2004 6:02:21 AM
Hi Everyone,

I tried to bcp in the data file to a table in sqlserver 2000.
The data file has got few blanks in certain columns.
My requirement is all those blanks has to be converted null while bcp
in the data.

1. I have tried giving the option -k - Didn't work
2. I have tried creating a format file with prefix length 2 i.e as the
column is character.
3. Initially it was giving string data truncation error due to the
service pack3. Then I updated the service pack 3 also.

Pls someone help me out as this is very critical.

Thanks,
John Bell
7/14/2004 12:33:22 PM
Hi

An empty string is not the same as a null value. The -k option will not help
you with that. If you want to ignore the whole column then you can use the
format file to ignore the column. If you want to change these values after
loading use a subsequent update statement.

John



[quoted text, click to view]

AddThis Social Bookmark Button