Thursday, April 21, 2016

SSMS Gems #4

When editing in SSMS and you want to delete a whole line, do you highlight it and then click delete?  Ever mess that up and have to CTRL-Z a few times, or worse, not CTRL-Z and not notice you got more or less than you wanted to get?

Type out a line you want to get rid of - maybe it is already commented out in a query.  Place your cursor anywhere on that line.  Hold Shift and hit the keyboard Delete button.  The whole line is destroyed and everything below moves up.

Want to comment out a section quickly? Enable the Text Editor menu (Right-Click on a menu above and check Text Editor)  Highlight the section you want to comment out and click the selection comment icon.   This one is so handy, I keep the text editor up all the time.

 
By the way, you can customize any of the menus with any available command.  You could grab this item and put it into your own custom spot if you don't want to lose any space on your interface.

Tuesday, April 19, 2016

SSMS Gems #3

This one is pretty simple.  I am not sure how long it took me to figure out that a right-click in the Query window would produce a context menu, where you can do things like change your connection for the query you are on, insert a snippet, and a host of other useful things.  It looks like this:
 
This context menu has essentially the same content as the Query menu, which incidentally, only appears when your focus is in the query menu.  If you click into the navigation pane, the Query menu will disappear.
 

Free is Good. Affordable even.

Microsoft has announced that SQL Server Developer Edition is now Free.   You have to sign in, but you can get 2014 now and 2016 when it comes out.  What a great way to check out the new features and keep up to date!  Check it out here

Monday, April 18, 2016

Universal SSMS

I am reading Aaron Bertrand's interview with Ken Van Hyning, Engineering Manager for SQL Server Client Tools at Microsoft.   Ken's Twitter

It is really good to know that there is a passionate tool guy who is heading the team to improve the SSMS tool.  

My favorite Question and Answer:
What has been the funniest thing that has happened so far in this project?
This question is a bit tougher for me… I’m not sure if they are funny or not but it makes me laugh. :-)
As we have been rebuilding the SQL Client Tools team over the last several months, we have a lot of new engineers. Many of which have been at MS for only a few years now. Being in SQL everyone knows of SSMS of course, but it’s been great time after time showing folks how many things are there. They have no idea how vast it is. UCP is kind of a running joke as one of the most unknown, unused, but massive features hiding within SSMS. I show folks how registered servers works, what CMS is and they get all wide-eyed. The fact that we have things like Point-in-time restore all the way to an AG dashboard. And oh my, the first time I explained what PBM was and the server-side enforcement through SQL Agent. Even I keep finding things that folks have added over the years that I didn’t know were in SSMS now. Sometimes we feel like we are on an archeological expedition and we keep finding troves of SQL Server manageability treasures.


In the meantime, I'll keep sending out the gems I have found and keep finding...

Here is another good read from Aaron What do the Changes in SSMS Mean to You




Sunday, April 17, 2016

SSMS Gems #2 Save the Angels.

Here's a really quick hitter that is just awesome for anyone who deals with block format lists.  

Got a list of stuff you want to edit in SSMS?

It might look like this:

Select * from Table01
Select * from Table02
Select * from Table03
Select * from Table04
Select * from Table05
            ^

(BTW, every time a Select * is performed in production, a little angel dies in heaven.)

Put your cursor right on the position following the * (just above my ^), hold down Alt and left-click dragging the cursor vertically and then left one character to highlight all of the *.  Type Name.  Booya, you have saved 5  little angels from an ignominious and sudden death.

You could do the same to highlight all of the selects and change them to delete, or update or whatever.   Delete is my favorite, to keep it clean and happy.   You should find yourself more productive when typing endlessly in SQL development.

All the little angels will thank you. 

Thursday, April 14, 2016

SSMS Gems #1

I spoke at SQLSaturday499 in Madison recently, and tried to cover a whole bunch of SSMS Tips and Tricks for productivity.   You can download my scripts and powerpoint here.

There is very little that is new or original in the world, so first let me say a big thanks to Wayne Sheffield (blog)  for sharing many of the tips at the PASS summit and Sean & Jen McCown (the Midnight DBA's) (website) for the Summit Pre-Con that introduced me to RegEx inside SSMS.

Here's a tip that was not in my presentation, but was pointed out by a person in my SQLSat499 talk:

Scenario:   You need to cut and paste several different things from one place to another in SSMS.

Cut/Copy all of your items from the source to the clipboard with your normal method (CTRL-X, CTRL-C)

To expose the clipboard items when pasting, hold down CTRL-SHIFT and use V as a toggle.   You will toggle through your clipboard snips.

Keep coming back for more SSMS Gems, and follow me @007SQL