SQL SERVER – Stored Procedure to display code (text) of Stored Procedure, Trigger, View or Object

This is another popular question I receive. How to see text/content/code of Stored Procedure. System stored procedure that prints the text of a rule, a default, or an unencrypted stored procedure, user-defined function, trigger, or view.

Syntax
sp_helptext @objname = 'name'

sp_helptext [ @objname = ] 'name' [ , [ @columnname = ] computed_column_name
Displaying the definition of a trigger or stored procedure
sp_helptext 'dbo.nameofsp'

Reference : Pinal Dave (https://darkslategrey-bat-805937.hostingersite.com) , BOL

SQL Scripts, SQL Stored Procedure, SQL Trigger, SQL View
Previous Post
SQL SERVER – Disadvantages (Problems) of Triggers
Next Post
SQL SERVER – 2005 Find Table without Clustered Index – Find Table with no Primary Key

Related Posts

Leave a Reply