BCP Operation with Currency Codes

  • Hello all,

    I am doing BCP Out operation out of a sql table on SQL Server 2005. I have two columns in the table; which are currency codes columns.

    Curr_Code varchar(1)

    Curr_Code_Euro varchar(1)

    I am outputting file in to CSV file.

    everything is fine except Currency columns:

    for "£" i am getting "œ" and for "€" I am getting "_" in the output

    declare @sql as varchar(1000)

    set @sql = 'bcp "select * from test_rjp" queryout "\j-serv-01\vg\temp\test.csv" -c -t, -Usa -P abcde'

    exec master..xp_cmdshell @sql

    Can somebody help please??

    Thx,

    -RP

    -RP
  • Try using "-C" (uppercase) and defining your database/Column collation.

  • Thanks a lot... it solved my issue right away.

    -RP

    -RP
  • ...Thanks; just resolved my issue too, appended a "...-C RAW" statement to the bcp command syntax;

    SET @bcpCommand = 'bcp "EXEC <SP> ''' + @batchID + ''', 1" queryout "' + @sFileSpec1 + '" -t"," -c -T -C RAW'

Viewing 4 posts - 1 through 3 (of 3 total)

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