SQL SERVER – Query Analyzer Short Cut to display the text of Stored Procedure

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.

As SQL Server 2005 and onwards version of SQL Server now uses Management Studio instead of query analyzer.

Here are additional blog posts related to the this blog:

Let us see the fastest way to display code of the SP.

First, go to SQL Server Management Studio and select option Results to Text (shortcut CTRL+T).

SQL SERVER - Query Analyzer Short Cut to display the text of Stored Procedure displayspcode1

Next type following script in Query Editor and hit execute. Do not forget to replace the string ‘NameofYourSP’ with the name of your actual stored procedure.

Reference: Pinal Dave (http://www.SQLAuthority.com)

, , ,
Previous Post
SQL SERVER – SQL Joke, SQL Humor, SQL Laugh
Next Post
SQL SERVER – UDF – Function to Convert Text String to Title Case – Proper Case

Related Posts

34 Comments. Leave new

  • Shantilal Suthar
    September 24, 2019 2:31 pm

    For Microsoft SQL Server Management Studio 14.0.17119.0, follow below steps to set shortcut key:

    Step 1: Tools >>Options>> Environment>>Keyboard and then click on the expansion arrow to list the options under
    Keyboard.

    Step 2: Click on the ‘Query Shortcuts’ option and you will see a list of some shortcut.

    Step 3: Type ‘sp_helptext’ under Stored Procedure column next to your preferred shortcut key and press Ok button.

    Step 4: Close and Open the Microsoft SQL Server Management Studio editor and check.

    Hope this will help.

    Thank you.

    Reply

Leave a Reply

Menu