Some things you take for granted in management studio, they are just there I have used them for years then you find something that someone else uses and you didn’t. So some of the following might be known some hopefully might be useful.
Commenting out code can be achieved several ways, there is the usual — or you can comment out entire blocks with /* Comments here */
Also as shown below there are buttons for commenting out / uncommenting select text.
You can even comment out between lines of code like below. Where OrderDate is commented out within the line
Productname,/* OrderDate, */ Qty
! Quick Tip, add comments to your code describing what it does it and why if it’s not straight forward as when you come back in 6 months or someone looks at the code it might hlep
Management Studio Settings (All versions)
Click on Tools / Options/ Query results / Results to grid .Two settings I religiously change from default.
The include query in result set , shows you the exact query that’s been ran in the comments section as shown below. Once changing these setting they only take effect in a new window. Very useful if you’re running a set of queries and come back to your desk, which one was I up to ? now you know!