Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limitations with bcp utility

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I'm writing a script using bcp to transfer data from SQL 2000 to a file and vice versa. My database schema is composed by several tables and everthing works perfectly for all of them except one. This table contains a field which contains a long string. (Max 1000 chars).
When I dump the database...that works..but when I try to feed another database (with the same schema) an error is raised:
Starting copy...
SQLState = 22001, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation

Has somebody an idea about this error and how can I fix my problem?
thx
david
 
I don't think that the code for the bcp utility has changed since SQL6.5 where the maximum size of a varchar was 255. I guess that this is where the problem is. You'll have to look for details in Books On Line.

I take it that this will be a regularly run script. For a one-off you might get away with checking the data to see how many fields actually overrun the 255 mark then carry on. Maybe you might need to reduce the size of the database field? Not sure.... My home ----> My company ->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top