How to view the stored procedure code in SQL Server Management Studio

DG3 picture DG3 · Jan 4, 2012 · Viewed 234.5k times · Source

I am new to SQL Server. I am logged into my database through SQL Server Management Studio.

I have a list of stored procedures. How do I view the stored procedure code?

Right clicking on the stored procedure does not have any option like view contents of stored procedure.

Thanks.

Answer

Kniganapolke picture Kniganapolke · Jun 12, 2013

I guess this is a better way to view a stored procedure's code:

sp_helptext <name of your sp>