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

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

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.

[youtube=http://www.youtube.com/watch?v=s5vLGtDYGU4]

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 (https://darkslategrey-bat-805937.hostingersite.com)

Database, SQL in Sixty Seconds, SQL Scripts, SQL Server Management Studio
Previous Post
SQL SERVER – Monitoring SQL Server Database Transaction Log Space Growth – DBCC SQLPERF(logspace) – Puzzle for You
Next Post
SQL SERVER – Retrieve SQL Server Installation Date Time

Related Posts

Leave a Reply