SQL SERVER – Tricks to Comment T-SQL in SSMS – SQL in Sixty Seconds #019 – Video

60 SQL SERVER   Tricks to Comment T SQL in SSMS   SQL in Sixty Seconds #019   Video

Code commeting is the one of the most common tasks developers perform. There are two major reasons why developer comment code. 1) During Debug 2) Documenting the code. While debugging the T-SQL code I have often seen developers struggling to comment code.  They spend (or waste) more time in commenting and uncommenting  than doing actual debugging of the procedure.  When I see developer struggling to comment the code I feel little uncomfortable as commenting should be a very easy task over. Today we will see three quick method to comment T-SQL code in Query Editor.

There are three different method to comment and uncomment statements in SQL Server Management Studio

  • Using Keyboard Shortcuts
  • Using Tool Bar
  • Using Menu Bar

Method 1: Using Keyboard Shortcuts

Commenting the statement – CTRL+K, CTRL+C

Uncommenting the statement – CTRL+K, CTRL+U

Method 2: Using Tool Bar

Using Tool bar buttons. (See Video)

Method 3: Using Menu Bar

Commenting the statement – Menu Bar >> Edit >> Advanced >> Click on Comment Selection.

Unommenting the statement – Menu Bar >> Edit >> Advanced >> Click on Uncomment Selection.

More on Importing CSV Data:

I encourage you to submit your ideas for SQL in Sixty Seconds. We will try to accommodate as many as we can.

If we like your idea we promise to share with you educational material.

Reference: Pinal Dave (http://blog.sqlauthority.com)

5 thoughts on “SQL SERVER – Tricks to Comment T-SQL in SSMS – SQL in Sixty Seconds #019 – Video

  1. dave

    from my observations since becoming an avid watch and learn not to mention savvy individual we are primarily working with the MS SQL system?

    or mySQL, postgresql, tivoli frameworks? and other sql server wares included?

    when i discovered sql i was totally lost with it a few years back but using the “my” version since build 5.0.37, including all 5.1 builds and currently 5.5.24 with apache modules. i used to use IIS7 but it was(IMO) a migraine headache and stressful(IMO) so i reverted back to apache and i do pretty good with mySQL for someone that wings it and learns it as he goes so can someone if not yourself ever so kindly bring me up to par/speed with heresay, Please?

    thanks. love this forum/blog. glad i found it and im sure i can get something out of it that i may need and hopefully can contribute something in the not so distant future. happy indpendence day evening 2012 and many blessings….



  2. Pingback: SQL SERVER – Remove Debug Button in SSMS – SQL in Sixty Seconds #020 – Video « SQL Server Journey with SQL Authority

  3. Pingback: SQL SERVER – Weekly Series – Memory Lane – #036 | Journey to SQL Authority with Pinal Dave

Leave a Reply

Fill in your details below or click an icon to log in:

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 )

Google+ photo

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

Connecting to %s