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 -> KeyboardStep 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 Key | Command |
Ctrl + T | Query.ResultstoText |
Ctrl + D | Query.ResultstoGrid |
Ctrl + Shift + F | Query.ResultstoFile |
Ctrl + N | File.NewQuery |
Ctrl + S | File.SaveSelectedItems |
Ctrl + O | File.OpenFile |
Ctrl + F | Edit.Find |
Ctrl + H | Edit.Replace |
Ctrl + Z | Edit.Undo |
Ctrl + Y | Edit.Redo |
Ctrl + A | Edit.SelectAll |
Ctrl + C | Edit.Copy |
Ctrl + V | Edit.Paste |
Ctrl + X | Edit.Cut |
Ctrl + Shift + U | Edit.MakeUppercase |
Ctrl + Shift + L | Edit.MakeLowercase |
Ctrl + K, Ctrl + C | Edit.CommentSelection |
Ctrl + K, Ctrl + U | Edit.UncommentSelection |
Ctrl + L | Query.DisplayEstimatedExecutionPlan |
Ctrl + M | Query.IncludeActualExecutionPlan |
Ctrl + J | Edit.ListMembers |