Wednesday, February 8, 2017

Fixing Hot-Key issue in SSMS in five steps.

A lot of people in the Internet complain about their version of SSMS "forgot" some hot-key combinations. The oldest complain I remember was about the most useful combination "Ctrl-R".

The reason why SSMS "forgets" is within code sharing and reusability with other Microsoft development products.
If you have that problem, most probably I have (or had in the past) installed something else from Microsoft, such as Development Studio, Data Tools etc.

Won't concentrate on that, just provide the solution:

At first, got to the "Options":
- Menu -> Tools -> Options

- Or just simply press Alt+T -> O

Then Open "Environment" -> "Keyboard" -> "Keyboard".

Click to the text box on lower right called: "Press shortcut keys" and press "Ctrl+R"

In the correct environment you should see something like this:
In the drop down box "Shortcut currently used by:" you should see an option "Windows.ShowResultsPane (Ctrl + R (SQL Query Editor))"

If you do not have it - that is your problem.

For the sake of a Demo, I'll remove it in my SSMS and will fix it step-by-step.

Here is the Fix:

Step 1.

Go to Menu -> Tools -> Options -> Environment -> Keyboard -> Keyboard

Step 2.

In the Left-Middle ListBox search for a value "Windows.ShowResultsPane" and select it.
You should get something like this:

Step 3.

In drop down box "Use new shortcut in:" select "SQL Query Editor" and in "Press shortcut keys" text box press "Ctrl+R" to get something like this:

Step 4.

Press "Assign" button.
By doing this you assign key combination "Ctrl+R" to "Windows.ShowResultsPane" event within "SQL Query Editor" environment.
As the result, you have to get a new line in "Shortcuts for selected Command:" drop down box: "Ctrl+R (SQL Query Editor)".

Step 5.

Press OK and test how "Ctrl+R" works.

It looks easy, isn't it? The complication is only in the fact that Configuration options in SQL Server Management Studio show and allow to change shortcut keys not only for SSMS, but for other applications too.

If you have a problem with other unassigned hot keys the biggest problem is to identify "command" to assign for the key you need.

Here is a small list of commands for the most useful keys:
Shortcut KeyCommand
Ctrl + TQuery.ResultstoText
Ctrl + DQuery.ResultstoGrid
Ctrl + Shift + FQuery.ResultstoFile
Ctrl + NFile.NewQuery
Ctrl + SFile.SaveSelectedItems
Ctrl + OFile.OpenFile
Ctrl + FEdit.Find
Ctrl + HEdit.Replace
Ctrl + ZEdit.Undo
Ctrl + YEdit.Redo
Ctrl + AEdit.SelectAll
Ctrl + CEdit.Copy
Ctrl + VEdit.Paste
Ctrl + XEdit.Cut
Ctrl + Shift + UEdit.MakeUppercase
Ctrl + Shift + LEdit.MakeLowercase
Ctrl + K, Ctrl + CEdit.CommentSelection
Ctrl + K, Ctrl + UEdit.UncommentSelection
Ctrl + LQuery.DisplayEstimatedExecutionPlan
Ctrl + MQuery.IncludeActualExecutionPlan
Ctrl + JEdit.ListMembers

Sunday, February 5, 2017

SQL Saturday #595 in Cleveland, OH

This SQL Saturday in Cleveland started for me with not very good weather.
I had a few free hours before speakers' dinner and wanted to use them to see the city, but unfortunately it was too cold and pretty snowy for any good picture:

Barely can see lighthouse because of falling snow

Here is a speakers' dinner:

I love Adam's t-shirt

Andy Yun and Erin Stellato: Princess Leia is talking to "Mr. Kim"

It looks like my camera is pretty scary

I'm almost first for the event. Organizers are almost ready.

No vendors yet.

That how it looks like from the second floor.

Speakers' room.

Crowd is ready for the keynote.

Eric Blinn is almost ready

Vishal Pawar preparing for his presentation

During a second sponsors are free

Frank Gill

Dave Bland

Delora Bradish

Matt Gordon

Before I was under the impression that only SQL Saturday in Baltimore is doomed with Pepsi products, but that happened to be even worse. In Cleveland is not just Pepsi, but DIET Pepsi. All beverages were diet!!! Evan pure water...

Speakers' room.

Fastest way from the speakers' room downstairs is a metal pipe. I've used it all the time.