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.
I was experiencing the same issue and found that it was caused by Tools -> Options -> SQL Server Object Explorer -> Scripting -> Convert user-defined data types to base types.
When this is "True" I lose my comment blocks. When "False" my comment blocks came back.
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.
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