Issue:
All – Visual Studio has an issue where it saves SQL files as UTF-8-BOM as default, which causes errors when concatenating for our DBAs. Please follow the attached instructions to install the “Fix File Encoding” Extension for Visual Studio.
This will fix the issue by saving your SQL files as UTF-8 (without BOM) by default.
Fix:
- In Visual Studio Go To manage Extensions and find “Fix File” extension
- Click Install. It will schedule your install.
- Close Visual Studio and then reopen to install the Extension.
- Add sql file extension to the Fix File Extension configuration.
- Go to Tools à Options…
- Scroll Down to “Fix File Encoding” and you will see a reg ex:
- Add |sql to this line as shown below:
- Click OK
- Close Visual Studio and Re-Open Visual Studio
- To test that this worked: Create a new SQL file. Save it. Then open it in Notepad++ and you can verify its encoding is UTF-8
Comments