BCP export with a comma row delimiter
I currently have a sproc that is exporting data to a csv file using bcp. It currently works fine except due to a change of requirment the file no longer can have a '\n' row delimiter and must now have a ',' row delimiter. From a quick search I found that the tag y开发者_运维百科ou need to add is '-r delimiter' however my export appears to now be in a different language encoding.
This is the logic I am using to build my execution query:
SET @tempSQL = 'bcp "select * from ' + @tempTableName + ' " queryout "' + @fileName +'" -T -c -t"," -r"," -k -CRAW'
Additional Details: When opening the file in Notepad++ or vim it looks fine however when viewed in notepad it looks like Chinese characters.
What encoding does Notepad think the file is? If I open an ASCII file wth Unicode selected for the encoding, that's what I see.
File -> Open, 'Encoding:' selector at the bottom of the dialog (on Win7)
精彩评论