In this article we will see how to create a custom shortcuts for stored procedures in SQL Server ?
In SQL Server, you can create a custom shortcut for stored Procedures . As a SQL developer, sometimes you have to monitor the output of any table or stored procedure frequently, means you need to execute stored procedure frequently. So it would be better if you create a shortcuts to execute the stored procedure instead of writing stored procedure name again and again then executing it, definitely that will save your time .
If you want to monitor any table data, you can write a stored procedure for that and create a shortcut to execute that stored procedure.
If you do not know, how to create a stored procedures then you can read the post : How to create a Stored procedures in SQL server.
Following are the steps to create a custom shortcut to execute stored procedure.
Suppose you want to monitor the latest top 100 customer data. So for this you have to create a stored procedure first than create a shortcut to execute that stored procedure.
Lets create a stored procedure first, If you do not want to create stored procedure you can use any existing stored procedure.
create proc get_customer as begin select top 100 * from customer order by 1 desc end
Now you can create a shortcuts by following below steps.
Click to Tools Tab then click on Options.. in context menu.
Once you click on Options.. a pop up window opens.
Now click on keyboard, after that click on Query Shortcuts.
Next, In Query Shortcuts: pane, write your stored procedure name in front of any shortcuts that you like.
After that click on OK button.
Now, go to Query Editor window and press your shortcut code.
Lets see the output of stored procedure by pressing shortcut key that is ctrl + 3, as you can see, it executes the stored procedure which returns the data.
It is really time saving, instead of writing stored procedure name and execute it now you can simply execute stored procedure by shortcut key.
309 total views, 1 views today