Quick SSMS Tip

Published On: 2019-09-11By:

It is widely known that I am a horrible speller and hate to type code. I tend to use a lot of code snippets and reuse code to avoid writing it. So, when I find little tips that make coding easier for me, I like to share.

Did you know that you can surround your code with a click of a button with IF, BEGIN END, WHILE code blocks? SQL Server Management Studio (SSMS) gives us the basic structure of a Transact-SQL statement code block as a starting point.

Take Look In SSMS

In a query window, Right Click and Choose Surround With (note the hot keys of Ctrl+K or Ctrl+S)

It will bring up a code “window” where you can choose which code block you want to add.

Here is what you get when you choose each one.

I am not sure if this has always been here or it’s a recent add that I just stumbled on to. Regardless,  this feature along with the full list of code snippets, as well as some custom ones I’ve utilized over the years definitely come in handy. You can find more on code snippets inside management studio here.

Contact the Author | Contact DCAC


Globally Recognized Expertise

As Microsoft MVP’s and Partners as well as VMware experts, we are summoned by companies all over the world to fine-tune and problem-solve the most difficult architecture, infrastructure and network challenges.

And sometimes we’re asked to share what we did, at events like Microsoft’s PASS Summit 2015.

Awards & Certifications

Microsoft Partner   Denny Cherry & Associates Consulting LLC BBB Business Review    Microsoft MVP    Microsoft Certified Master VMWare vExpert
INC 5000 Award for 2020    American Business Awards People's Choice    American Business Awards Gold Award    American Business Awards Silver Award    FT Americas’ Fastest Growing Companies 2020   
Best Full-Service Cloud Technology Consulting Company       Insights Sccess Award    Technology Headlines Award    Golden Bridge Gold Award    CIO Review Top 20 Azure Solutions Providers
Share via
Copy link