SSMS saves in a different encoding when saving a modified stored procedure instead of a new file

Paolo Ponzano 1 Reputation point
2020-07-10T12:33:57.12+00:00

Hello,
Please excuse me, but I've found occasionally this "bug" when pushing to git .sql files.
The situation is this:

  • Open a stored procedure from Object Browser on a SQL Server instance
  • Save as without changing the encoding. It's saved as UCS2-LE BOM (I used notepad++ to read the encoding). This kind os Encoding doesn't work well with Git since it reads it as binary
  • Create a new SQL file, then save it. It's saved as UTF-8

Now without discussing the fact that git won't recognize the first as a binary and there's a Powershell script that changes the address, I think that there should be:

  • Only one type of Saving Encoding
  • There should be a default option under Tool -> Options to set the default encoding (and should apply to both)

This happens on SQL Server Management Studio 15.0.18330.0

Thanks in advance
Paolo

Community Center Not monitored
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2020-07-10T12:34:57.153+00:00

    SQL server is not currently supported here on QnA. They're actively answering questions in dedicated forums here.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver

    --please don't forget to Accept as answer if the reply is helpful--


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    0 comments No comments

  2. Leon Laude 86,026 Reputation points
    2020-07-10T12:35:20.917+00:00

    Hi,

    SSMS is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask the experts in the dedicated SQL Server Tools forum over here:
    https://social.technet.microsoft.com/Forums/sqlserver/en-US/home?forum=sqltools

    (Please don't forget to accept helpful replies as answer)

    Best regards,
    Leon

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.