I would just like to add a comment to my if-statement block, but I get an error when I try. I want to be more like Steve McConnell.
declare @ConstraintName varchar(255)
set @ConstraintName = 'PK_Whatever'
IF LEFT(@ConstraintName, 2) = 'PK'
BEGIN
END
The error I get is:
Incorrect syntax near 'END'.
If I add something after the comment, i.e. PRINT @ConstraintNameIt works great.
source
share