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.
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.
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.
go to 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.
click ok. now please go to a query window and select the stored procedure then press ctrl+3, it will show the stored procedure.
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.
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!
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.
Published at DZone with permission of Sibeesh Venu, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.