top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What is the difference b/w sp_help and sp_helptext ?

+2 votes
What is the difference b/w sp_help and sp_helptext ?
posted Jan 23, 2014 by Atul Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

Some times during the development process you need to see a definitions, dependencies or source code of user-defined rules (such as stored procedures, functions, views, tables, etc...).
From my experience I can tell that sometimes it takes allot of time to find it.

Fortunately, MS SQL provides a very useful stored procedures which can help us!

sp_help - Provides information about a database object, a user-defined data type, or a data type.


sp_help [ [ @objname = ] name ]


[@objname =] name

You can write object name, select it and use ALT+F1 shortcut to see it's definition.

sp_helptext - Displays the definition (source text) of a user-defined rule, default, unencrypted Transact-SQL stored procedure, user-defined Transact-SQL function, trigger, computed column, CHECK constraint, view, or system object such as a system stored procedure.


sp_helptext [ @objname = ] 'name'


[ @objname = ] 'name'

You can add sp_helptext to shortcut list: go to Tools -> Options, Environment -> Keyboard.
Type sp_helptext near to CTRL+F1, press OK button and restart the Microsoft SQL Server Management Studio.

answer Jan 25, 2014 by Asmita Agrawal
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.