Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-03-18 : 18:01:46
|
I have a bcp procedure that imports a CSV file of 30,000 rows into a working table. I get a few errors reported as so:Starting copy...1000 rows sent to SQL Server. Total sent: 1000SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation 1000 rows sent to SQL Server. Total sent: 20001000 rows sent to SQL Server. Total sent: 30001000 rows sent to SQL Server. Total sent: 40001000 rows sent to SQL Server. Total sent: 50001000 rows sent to SQL Server. Total sent: 6000SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation 1000 rows sent to SQL Server. Total sent: 70001000 rows sent to SQL Server. Total sent: 80001000 rows sent to SQL Server. Total sent: 9000SQLState = 22001, NativeError = 0Is there any way to get bcp to state the exact row so I can have a look at what string data is being right truncated??Sam |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-18 : 18:09:43
|
| You could create a staging table with a wider row (each column wider) so that it fits...then run queries against that staging table to find the rows that were too big to fit in your original table.Just one idea....Jay White{0} |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-03-18 : 18:21:49
|
The errors are gone.Now I'm left wondering what it was. Maybe more sleuth work is due.Sam |
 |
|
|
Guttless
Starting Member
2 Posts |
Posted - 2007-02-26 : 14:34:59
|
| I am having the same problem you were having with the BCP error, except it will not load not even one row.SQLState = 22001, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]String data, right truncationI have checked my fields on the source and destination tables, same schema. I have no idea what the problem is at this point.Here are my out and in commands:bcp "exec IRIS.dbo.QualifyMedClaims" queryout S:\Atlanta\_AE\ExtractClaims_10_tmp.dat -Snameofserver -N -T -k -Ebcp IRIS.dbo.ExtractClaims_10_2 in S:\Atlanta\_AE\ExtractClaims_10_tmp.dat -nameofserver -N -T -k -E |
 |
|
|
|
|
|
|
|