2

I have a view which contains special (Danish/Norwegian) characters. I want to select some rows and export them in a csv file. I created a batch file sqlselection.bat and contains the following code:

"C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd" -f o:65001 -S myDBserver,1433\myDB -U myUser -P myPassword  -s, -W -Q "Select * from myDB.dbo.myview" > "D:\exportTo\here.csv"

Running sqlselection.bat by doubleclicking the .bat file produces the file here.csv with the correct codepage. However, running the same batch file as a trigger on a scheduled task, creates the file here.csv without the special characters.

The characters ø,æ,å are replaced with a single quote "'" and it's driving me INSANE! By this stage I've hit a dead-end and I am open to any suggestion. Any takers? single quote replaces special character

the scheduled task

0 Answers0