SQL Server Keyboard Shortcuts – what happened to the amazing ALT + F1 keyboard shortcut?

Hi Friends,

Ask any SQL DBA for his favorite SQL Server Keyboard Shortcuts and most would reply; ALT + F1. But what has gone wrong now?

Option 1: Select the table name and press ALT + F1.
Result: Doesn’t work.
Error: Msg 15009, Level 16, State 1, Procedure sp_help, Line 66
The object ‘SalesOrderHeader’ does not exist in database ‘AdventureWorks2008R2’ or is invalid for this operation.

1_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

Option 2: Select the schema & table name and press ALT + F1.
Result: Doesn’t work.
Error: Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ‘.’.

2_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

Option 3: Enclose the table name in square brackets, Select and press ALT + F1.
Result: Same as option 1

3_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

Option 4: Enclose the schema & table name in square brackets, Select and press ALT + F1.
Result: Same as option 2

   

4_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

Option 5: Enclose the schema & table name in single square brackets, Select and press ALT + F1.
Result: Works 🙂

5_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

But, does the select statement work in case of option 5?

NOOOOOOOOOOO !

6_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

Now try all the above 4 options with table DatabaseLog
Result: it all works 🙂

7_SQL_Server_what_happened_to_the_ amazing_ALT_F1_keyboard_ shortcut

Conclusion:  I am confused 😉 Really?

Well, Databaselog belongs to dbo schema. ALT + F1 shortcut works the way it should work for tables belonging to dbo schema.

Feedback, comments and your observation is welcomed. If you can get it working with other schema, do let us know. I tried all the above in SQL Server 2008 R2. I don’t know who it is like in SQL 2012.

 

 

   

About Amit Bansal

Amit Bansal is always brainstorming around SQL Server. Despite working with SQL since 1997, he is amazed that he keeps learning new things every single day. SQL Server is AB's first love, and his wife does not mind that. He tries to share as much and spreads the SQL goodness. Internals and Performance Tuning excites him, and also gives him sleepless nights at times, simply because he is not a genius, but quite a hard worker and does not give up. It has been a long and exciting journey since 1997, you can read here: http://sqlmaestros.com/amit-bansal/ He is on Twitter: https://www.twitter.com/A_Bansal

View all posts by Amit Bansal →

6 Comments on “SQL Server Keyboard Shortcuts – what happened to the amazing ALT + F1 keyboard shortcut?”

  1. Hi Amit

    This is because of your default schem is dbo, please change it sales, it will start working for sales & dbo both.

  2. Hi amit,

    This is because of your default schema is dbo, please set it to sales “ALTER USER [ijs] WITH DEFAULT_SCHEMA=[sales]” then it will start working for both dbo & Sales.

    Thanks
    Indrajeet

Leave a Reply

Your email address will not be published.