sql-serverstored-proceduresssms

SSMS removing pre-BEGIN comments from my stored procedures


I'm running SSMS 12.0.2000.8

If I use the SSMS query editor to create a stored procedure (such as the one below) the comments before BEGIN are removed when I execute/save it:

CREATE PROCEDURE myproc
/* Say goodbye to this comment */
    @var1 int -- this comment will disappear too
AS
BEGIN
   /* This comment is safe */
   select 'hello' -- this too shall endure
END

A colleague is running the same version of SSMS and has no such problems. If I execute one of his scripts using sqlcmd.exe the comments get stripped then too. I presume there must be a global setting that I need to change but I have no idea where it might be.


Solution

  • After observing some other strangeness (namely with execute as caller being added to my scripts), I did some Googling and discovered the answer:

    delete \Users\[user]\AppData\Roaming\Microsoft\SQL Server Management Studio\12.0\sqlstudio.bin
    

    WARNING: You will lose your current list of memorized SQL Servers/usernames/passwords.