471,893 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,893 software developers and data experts.

BCP -k option - Very urgent

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,
Ganesh
Jul 20 '05 #1
1 1623
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

"Ganesh Babu" <ga*****************@wipro.com> wrote in message
news:35**************************@posting.google.c om...
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,
Ganesh

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

28 posts views Thread by Tamir Khason | last post: by
16 posts views Thread by | last post: by
3 posts views Thread by N. Spiker | last post: by
5 posts views Thread by =?Utf-8?B?c3VydHVyeg==?= | last post: by
8 posts views Thread by Rory Becker | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.