Most actions in SQL Server that are started by clicking on icons can also be triggered by a keyboard shortcut. I’ve linked to a few that I frequently use in SSMS (SQL Server Management Studio). However, there are times that you want to create your own shortcuts.
For example, the shortcut to stop a running query is Alt + Break. However, I don’t have a Break button on my work laptop. On my laptop, I can use Function + B as a replacement for Break, so Function + Alt + B will stop query execution. I decided to create a new shortcut that uses two key presses.

Create New Keyboard Shortcut:
On the Menu bar, go to Tools, then Options.
In the left pane, select Environment, then Keyboard. You should see something like this:

You can search for a command in the ‘Show commands containing’ box. We want to find Query.CancelExecutingQuery.
In the ‘Press shortcut keys’ box, you press the key combination you want to use as the shortcut. I chose Alt + Delete. If the selected shortcut is already in use, you’ll see it come up in the ‘Shortcut currently used by’ box. Press ‘Assign’ to save that shortcut, then ‘OK’ to exit.

That’s it, the shortcut is ready to use.

Code Outline Toggling:
In SSMS, certain regions of code (Like BEGIN .. END) can be collapsed or expanded.

The File menu lists Ctrl + M, Ctrl + L as a shortcut to expand or collapse all of these nodes in a query window, but it wouldn’t work for me. When working with scripts of stored procedures, it is useful to be able to expand and collapse the regions. I followed the same instructions to create a shortcut for Edit.ToggleAllOutlining. I used Alt + T (For Toggle), which wasn’t in use.

I definitely recommend becoming familiar with some of the common shortcuts, I find I can work quicker from the keyboard rather than using the mouse. You could start with executing a query (F5 or Control + E) and displaying/hiding the Results pane (Control + R), those are the ones I use the most.

Links:

SQL Rob – SSMS Shortcuts

SQL Rob – Windows Shortcuts