2012年3月8日星期四

BCP fail

Hi,

I'm a newbie to MSQL trying to examine ways in which I can work with a client's data. I'm using the evaluation version of MSQL.

I'm trying to import data from a .dat file created using bcp by the client. The row delimiter is '#'.

I have created a table with the same amount of columns, varchar, 255, nulls allowed. My bcp command is:

bcp dbase_name..table_name in D:\tables\table.dat -n -o D:\tables\error.err -U MyUser -P MyPass -S Myserver

This returns the following error:

SQLState = 22001, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]String data, right truncation
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP data-file

As I understand, this indicates that the format of the destination table is not appropriate for import. However, I am unable to see what further parameters I should specify in the destination table. What have I overlooked?

All help appreciated - thanks for your indulgence.

James TonerI don't know if you ommited this by mistake but if you are using a
row terminator of # then shouldn't also be including -r# in your
bcp in command ?

没有评论:

发表评论