Click here to Skip to main content
15,885,767 members
Articles / Programming Languages / T-SQL
Tip/Trick

Create Query Shortcuts in SQL Server Management Studio

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
31 Jan 2017CPOL1 min read 13.8K   2   1
Shortcuts to execute your query faster while working or debugging T-SQL statement

Introduction

Generally, we are checking your queries or debugging previously written queries and in between we have to check other things. For that, we can take the help of shortcuts. This shortcut will speed up your working.

Using the Code

We can create shortcuts for commonly used queries in SSMS. Some of the shortcuts are predefined, like "Alt + F1" will execute "sp_help" and "Ctrl + 1" will execute "sp_who" which we are using in routines. You can create new shortcuts for your own queries to speedup.

To create a own shortcut, open SSMS and go to : Tools > Options > Environment > Keyboard > Query Shortcuts

For example, we can create a shortcut for:

SQL
//
// "Ctrl + 3 " : SELECT * FROM (single space after from keyword)
//

Image 1

Now just write a name of table in new query and press "ctrl + 3" and the query will be executed.

Image 2

Now, working in any query or stored procedure, this will help you a lot to check the data in the specific table or count of table.

Below are some examples of shortcut.

  • "ctrl + 3" for all the records in specific table
  • "ctrl + 4" for total count of specific table
  • "ctrl + 5" to get text of store procedure

Image 3

Points of Interest

You have still more shortcuts to create by yourself. Now make your own shortcut and speedup your working.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) MSP
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionHow to append some thing at end Pin
Wasim Ud Din Malik13-Dec-17 23:54
Wasim Ud Din Malik13-Dec-17 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.