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?

link|improve this question
Have found a solution. It turns out that our servers had been configured such that the version number of the bcp tool executable didn't match the version number of the Sybase ASE instance hosting the database. Just thought I'd mention this here in case it's useful to someone else who runs into the same problem. – chromeplatedbanana Dec 4 '11 at 17:54
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.