BCP russian charcters to file

  • Having a a few issues with exporting data from from a table in SQL server 2008 R2. Basically the table holds a nvarchar(4000) column which has text strings. These strings can be in numerous languages such as English, French, Russian, Spanish etc.

    When exporting the contents of the table to CSV using bcp some characters are being exported as question marks rather than the original characters. This predominantly affects Russian text.

    I have tried all of the following versions of the command but none have managed to output the data as it appears in the SQL engine.

    bcp "Messages" out D:\temp\messages.csv -t-S DBSTAGE101 -d dbetc -T -n

    bcp "Messages" out D:\temp\messages.csv -t-S DBSTAGE101 -d dbetc -T -N

    bcp "Messages" out D:\temp\messages.csv -t-S DBSTAGE101 -d dbetc -T -c

    bcp "Messages" out D:\temp\messages.csv -t-S DBSTAGE101 -d dbetc -T -C

    Any suggestions?

    MCITP SQL 2005, MCSA SQL 2012

  • Figured this out, the column is a ntext column, so once converted to a NVARCHAR(MAX) and using queryout with BCP the data is written to file in the correct format.

    MCITP SQL 2005, MCSA SQL 2012

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply