Home > SQL Challenge > SQL #53 – Keyboard shortcut Alt + F1 works now in SSMS 2012

SQL #53 – Keyboard shortcut Alt + F1 works now in SSMS 2012

Keyboard shortcut Alt + F1 works now

SSMS has a rich set of keyboard shortcuts that works by default. But in SSMS 2008 I had one complain about the default Alt+F1 shortcut. The Alt+F1 shortcut is assigned to sp_help by default.  It worked for tables, sort of. If you are a good designer and had followed the best practice of putting your tables in the appropriate schemas, using the Alt+F1 shortcut is quite a pain. You will need to wrap your schemanized table as the following for the shortcut to work.

[HR.Empoyees]

Check out this older blog.

SQL #49 – Retrieve table structure with keyboard shortcut in SQL Management Studio (SSMS)

Not any more in SSMS 2012. The fix is finally done. Either of the following will work by default. The old way of wrapping with [ ] will no longer work.

  • [HR].[Empoyees]
  • HR.Empoyees

This shortcut is equivalent to execute the sp_help procedure.

sp_help ‘[HR].[Empoyees]’

Assign keyboard shortcut to sp_helptext

The system procedure sp_helptext is a great helper for developers who work on SQL codes day in and out. I used to have Ctrl+F1 mapped to it. Unfortunately, by default, in SSMS 2012, the shortcut Ctrl+F1 is now mapped to Display SQL Server Books Online.

SQL Server Management Studio Keyboard Shortcuts

There are people who tried to re-map it. But it just seems a bit too much to re-map it. So I decided to map the Ctrl+3 key to sp_helptext.

Highlight both of the following text and press Ctrl+3, you will get the procedure definition.

  • [sp_helpfile]
  • sp_helpfile

 

It is equivalent to executing sp_helptext.

sp_helptext ‘[sys].[sp_helpfile]’

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: