SQL Server Error Messages - Msg 113
Error Message
Server: Msg 113, Level 15, State 1, Line 1
Missing end comment mark '*/'.
Causes
There are 2 ways of specifying comments in a Transact-SQL script, namely with the use of two hyphens (--) for single-line comments, and with the use of /* and */ for multi-line comments. This error message occurs when using the /* and */ for multi-line comments and the closing */ is missing.
The simplest way to get this error is as follows:
/* This script is used to generate error 113
SELECT GETDATE()
Msg 113, Level 15, State 1, Line 3
Missing end comment mark '*/'.
Another way this error can be encountered is with nested comments. Transact-SQL supports nested comments, which are simply comments within another comment. If the /* character pattern occurs anywhere within an existing comment, it is treated as the start of a nested comment and therefore, requires a closing */ comment mark. To illustrate this situation, the following script will generate the error:
/*
PRINT 'Multi-line comments start with /*'
*/
SELECT GETDATE()
Msg 113, Level 15, State 1, Line 4
Missing end comment mark '*/'.
Even though there is a closing */ comment mark in the script and even though the second opening /* comment mark is inside a string value, the second opening /* comment mark is treated as the start of a nested comment and there requires a separate closing */ comment mark.
Even if the line containing opening /* comment mark is already commented out using the two hyphens single-line comment, the error will still be generated as can be seen in the following script:
/*
--PRINT 'Multi-line comments start with /*'
*/
SELECT GETDATE()
Msg 113, Level 15, State 1, Line 4
Missing end comment mark '*/'.