top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference b/w sp_help and sp_helptext ?

+2 votes
1,914 views
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.

Syntax

sp_help [ [ @objname = ] name ]

Arguments

[@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.

Syntax

sp_helptext [ @objname = ] 'name'

Arguments

[ @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
...