Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the keyboard shortcut to view a SQL Server 2005 (Management Studio) stored procedure

I heard that there is a keyboard short cut to bring up the code of a SQL Server 2005 (Management Studio) stored procedure. This key combination would do the same function as sp_helptext.

This may only be an Urban Legend.

Thanks

like image 821
codingguy3000 Avatar asked Jul 22 '09 19:07

codingguy3000


People also ask

How do I view a stored procedure in SQL Server Management Studio?

Using SQL Server Management StudioExpand Databases, expand the database in which the procedure belongs, and then expand Programmability. Expand Stored Procedures, right-click the procedure and then select Script Stored Procedure as, and then select one of the following: Create To, Alter To, or Drop and Create To.

How do I view Stored Procedures in management studio?

In SQL Server Management Studio, first connect to the Database Engine. Next, under Object Explorer, expand the database in which you have created a procedure, and then expand “Programmability” option. Next, expand “Stored Procedures”, right-click the procedure you want and then select “Properties” option.

What does Ctrl F5 do in SSMS?

Execute Scripts in SQL Server Management Studio If you want to parse all the scripts without executing them in the current query window, simply press CTRL+F5 or you can select some lines of code to be parsed then press CTRL+F5.

How do I view a stored procedure?

You can find the stored procedure in the Object Explorer, under Programmability > Stored Procedures as shown in the following picture: Sometimes, you need to click the Refresh button to manually update the database objects in the Object Explorer.


2 Answers

The first thing I do after installing management studio on a new machine is to set sp_helptext to be CTL+F1 in management studio.

Tools / Options / Environment / Keyboard / Ctrl-F1 == sp_helptext

Then, i can highlight any view, stored proc, function, whatever - and press CTL-F1 and get the text of the object in my results window. Not sure if this is exactly what you're looking for, but it definitely helps me to be more productive in the query windows.

like image 91
Scott Ivey Avatar answered Sep 18 '22 13:09

Scott Ivey


Just using the Ctrl + F1 for the first time it works well & displays the SP in the results grid.

Shortcut hotkey combination to view the code of an SP can also be done by the following:

  1. F8 - Open Object Explorer

  2. Arrow keys down to SP

3 Right Click (usually located between right windows key & right ctrl key)

4 Y - press Y which will select Modify

5 New Query Window opens with alter SP code

Hope this helps

like image 28
Catto Avatar answered Sep 20 '22 13:09

Catto