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;

2 comments:

Anonymous said...

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.

John Smith said...

Thanks for sharing this useful content. How to create stored procedure in mysql with example and 5 Career Pathways with an ITIL service transition certification Stored Procedure