canpoint
canpoint

Reputation: 859

sql server bcp import and float type right data truncation

I have a table A and it has column CA with datatype float and contains a data like 35,44113. I have exported it with bcp out functionality as follows; In my exported .csv file data is exported as 35.44113

bcp <tablename> out <path> -U <username> -P <password> -S <servername> -c -Ccp1254 -t "|" 

when I wanted to import it as;

bcp <tablename> in <path> -U <username> -P <password> -S <servername> -c -Ccp1254 -t "|"

and it gives me string data right truncation bcp error. Using SQL SERVER 2008 R2

Any help?

Thanks

Upvotes: 0

Views: 1161

Answers (1)

Stagg
Stagg

Reputation: 2855

String data right truncation error suggested to me that your field lengths are greater than your table column definitions.

If you add -e error_file.txt to your bcp command it will provide more details of the error. e.g:

#@ Row 16, Column 15: String data, right truncation @#

From this you can adjust your table based on the file's data

Upvotes: 1

Related Questions