Get the Stored procedure Definition using Query

SQL Server March 2, 2017 Get the Stored procedure Definition using Query

Using SQL Server Management Studio

To view the definition a procedure in Object Explorer, connect to an  instance of Database Engine and then expand that Instance. Expand Databases, expand the database in which the procedure belongs, and then expand Programmability. Expand Stored Procedures, right-click the procedure and then click Script Stored Procedure as, and then click one of the following: Create To, Alter To, or Drop and Create To. Select New Query Editor Window. This will display the procedure definition.


Using Transact-SQL
To view the definition of a procedure in Query Editor System Stored Procedure: sp_helptext In Object Explorer, connect to an instance of the Database Engine. On the toolbar, click New Query. In the query window, enter the following statement that uses the sp_helptext system stored procedure. Change the database name and stored procedure name to reference the database and stored procedure that you want.



Would you like to know your project estimate?

Every project is special in its own way. We analyse all aspect of your project and provide you the precise cost and timeline with the proven development approach.

Get Estimate