SQL Server Management Studio ( SSMS ):- Embedded Comments

Background

I will like to talk on an error one can experience with Sql Server Management Studio ( SSMS ).

In this particular scenario, we are commenting out blocks of code.

 

Editor

Embedded Comments

Scenario

We have an embedded comment; without any control keywords.

Editor

/*


    /*
      a   
    */  
     

*/

Output Pane

Embedded Comments

Scenario

We have an embedded comment.

But, here we added a go statement between the comments.

Editor

/*


    /*
      a   
    */  
     go

*/

Output Pane

Image

Text

Msg 113, Level 15, State 1, Line 9
Missing end comment mark ‘*/’.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near ‘*’.

Error

  1. Msg 113, Level 15, State 1, Line 9
    • Missing end comment mark ‘*/’.
  2. Msg 102, Level 15, State 1, Line 11
    • Incorrect syntax near ‘*’.

Explanation

To correct our little error, we will remove the go keyword.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s