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:

  1. 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.
  1. 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
Last modified: September 9, 2024

Author

Comments

Write a Reply or Comment