This is quick but interesting trick to display the text of Stored Procedure in the result window. Open SQL Query Analyzer >> Tools >> Customize >> Custom Tab
type sp_helptext against Ctrl+3 (or shortcut key of your choice)
Press CTRL + T to enable the text view in result window.
Type any Stored Procedure name in your database, select the SP name and type Ctrl+4.
You will see the Stored Procedure text in the Result Window.
Reference: Pinal Dave (http://www.SQLAuthority.com)




Nice trick for shortcut of sp_helptext. :)
Is there any trick to do this in SQl Server Management Studio ??
There’s something to define shortcuts but it doesn’t work !!
I think we have to add something to indicate the selected text is the parameter of sp_helptext… but don’t know what !!
Thanks
In answer to Hollywood, the shortcuts thing (Tools | Options | Environment | Keyboard) does work, you just have to restart Management Studio before it recognizes the shortcut. It then takes the selected text as the parameter automatically
This is useful, but it’s something I am aware of. Call me lazy, but what I am looking for is a way to output the text (code) of a stored procedure in Text mode (results to text) in the Management Studio of SQL Server 2005. I can currently do this by a combination of Ctrl+T and Ctrl+F1 (which I’ve assigned to sp_helptext). Is there any way to achieve both actions using a single keyboard shortcut?
Hi
This is prabu really am enjoying your reply its simply good and i have a issue
This is am trying to use query shortcut i assigned the query for the short cut actually what i did is
1. Option -> Enviroinment -> Keyoard and then i set
ctrl +3 =Select * from
2.Then i come back to query window and selected a table and then i hit ctrl +3 but it dosen’t show anything if you help me for this its really usefull for me
thanks in advance
praburaj
Praburaj, you have to close and re-open management studio for it to “take”.