Mar 24, 2012

Missing end comment mark '*/' in Sql server


If we will execute following sql query:

/*
SELECT 1;

We will get error message:

Missing end comment mark '*/'

Cause: We have begin the comments in sql server but not ended.

Solution:

1. Use multiline comment:

/*
SELECT 1;
*/
      
2. Use singes line comment:

--SELECT 1;

1 comment:

  1. Anonymous9/04/2013

    You will also get this error if you put a "GO" or a semicolon inside the multi-line comment. This is because of an annoying bug in MS SQL 2008 that Microsoft refuses to fix.

    ReplyDelete