sybase bcp import fails

Posted by chromeplatedbanana on Server Fault See other posts from Server Fault or by chromeplatedbanana
Published on 2011-11-30T09:47:38Z Indexed on 2011/11/30 10:02 UTC
Read the original article Hit count: 1971

We're trying to export some tables from our production database to our test database using bcp. The bcp export seems to work fine, but the import always fails with a data type error (see below).

We tested on our test database exporting the table content to a file, then importing it in again immediately, but that failed too. e.g.,

bcp TABLENAME out ~/tempfile -S servername -U username

generates a file as expected. If we use -c option then the number of lines is as expected.

However,

bcp TABLENAME in ~/tempfile -S servername -U username

fails with

CTLIB Message: - L0/0D/S0/N0/0/0:
blk_int(): blk_layer: CT library error: Cannot find an equivalent CS_TYPE for this TDS data type  49
blk_init failed.

We get this whenever we try to copy into TABLENAME, whether from the production or test table dump file.

I don't understand why export and import for the same TABLENAME is generating a data type error. What am I doing wrong here?

Thanks

© Server Fault or respective owner

Related posts about database

Related posts about database-adminstration