DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. Keyboard Query Shortcuts in SQL Server Management Studio

Keyboard Query Shortcuts in SQL Server Management Studio

Keyboard shortcuts are incredibly important for the life of the productive developer, and not just for IDEs- If you're using SQL Server Management Studio then this article will help you get up to speed.

Sibeesh Venu user avatar by
Sibeesh Venu
·
May. 02, 16 · Tutorial
Like (5)
Save
Tweet
Share
46.54K Views

Join the DZone community and get the full member experience.

Join For Free

in this article, we are going to see some shortcuts that may be useful to you when you work with sql server management studio. you can always use some custom queries as query shortcuts in ssms, too. here i am going to show some of the most used the queries shortcuts. i hope you will like this.

background

if you are a dot net developer or if you are working with any microsoft technologies, you must have some experience in working with sql and sql server management studio. but, as a developer, we always try to achieve the things in a simple manner. right? this is where we are going for keyboard shortcuts. we do have an option to set and use the keyboard shortcuts in ssms too. i will explain those.

keyboard query shortcuts in ssms

first of all, let me tell you an example of where we can use the keyboard shortcuts. we know how to create stored procedures, right? these procedures are created in a folder called ‘stored procedures’ under programmability. now, let's assume that i have a stored procedure with the name as usp_get_salesorderdetail . now, if you need to see the queries we have written in that stored procedure, what will you do? you have two options:

  • right click on the stored procedure and click on modify
  • use the sp_helptext as sp_helptext usp_get_salesorderdetail

now, my question is, in this scenario, whenever you need to see the stored procedure you need to type sp_helptext right? how can we overcome this situation? here we can set the keyboard shortcuts.

setting the keyboard shortcuts

go to tools -> options.

tools_options tools_options

go to environment -> keyboard -> query shortcuts.

image title

environment_keyboard_query_shortcuts_

on the right side, you can see some shortcuts which are by default in ssms. now, if you need to add a new one, just click on any column under stored procedure column.

adding_a_new_keyboard_shortcut adding_a_new_keyboard_shortcut

click ok. now please go to a query window and select the stored procedure then press ctrl+3, it will show the stored procedure.

image title

sp_helptext_results_

now, if you need to select all the records from a table when you select the table and press ctrl+5 (you can select any key). you can make the shortcut as follows.

selct_query_as_keyboard_shortcut

selct_query_as_keyboard_shortcut

now, please go ahead and select the table name from the query window and press ctrl+4 (the key we selected). i hope you got the result as expected. have a happy coding!

conclusion

did i miss anything that you may think would help? did you find this post as useful? i hope you liked the article. please share your valuable suggestions and feedback in the comments.

your turn. what do you think?

a blog isn’t a blog without comments, but do try to stay on topic. if you have a question unrelated to this post, you’re better off posting it on c# corner, code project, stack overflow, or the asp.net forum instead of commenting here. tweet or email me a link to your question there and i’ll definitely try to help if i can.

Database sql

Published at DZone with permission of Sibeesh Venu, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Use MQTT in Java
  • 2023 Software Testing Trends: A Look Ahead at the Industry's Future
  • Why It Is Important To Have an Ownership as a DevOps Engineer
  • Integration: Data, Security, Challenges, and Best Solutions

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: