Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Quick SSMS Tip
WhatsApp
Monica Rathbun
5y
10.1k
0
8
100
Article
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 a 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 if it’s a recent addition that I just stumbled onto. 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
.
SQL Server
SSMS Tip
Up Next
Ebook Download
View all
Functions in SQL Server: Practical Guide
Read by 9k people
Download Now!
Learn
View all
Denny Cherry and Associates
Expert Consultants From HA to DR to up-time to SQL virtualization to scalability.
Membership not found