When we create stored procedures in Visual Studio (with the extension .sql) the file encoding is automatically set to 'Unicode (UTF-8 with signature) - Codepage 65001'.
This causes ours DBA's problems as their scripts don't like it.
We have to manually go in and change them to 'Western European (windows) - Codepage 1252'.
This only seems to be happening since we upgraded to VS 2008 from 2005. Can anyone explain whats going on and how to stop it?
From the File menu, choose Save File As, and then click the drop-down button next to the Save button. The Advanced Save Options dialog box is displayed. Under Encoding, select the encoding to use for the file.
Resave using correct encoding: File => Save As. Click the arrow next to the Save button. Choose the relevant encoding: Unicode (UTF-8 with asignature) - Codepage 65001.
In Visual Studio Code, press Ctrl+Shift+P (or F1) to open the Command Palette. Select MS SQL:Connect and choose Enter.
To summarise the link provided by Codeslayer (in case the page url changes)...
Change the sql file templates to ANSI encoding by opening with notepad and then saving it as an ANSI file. You can do the same for files already created. \Common7\Tools\Templates\Database Project Items
You've just made our DBA's very happy!
I think somebody faced a similar problem like yours and had the following workaround which is posted at
http://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=319830
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With