Saturday, August 08, 2009

SQL Server List all the Stored Procedures of a Database

List all the Stored Procedures of Database and their Definitions
using T-SQL in SQL Server 2005/2008 | Sql Server
From this query you can view all Stored Procedures in DataBase.
-------------------------------------------------------------------------------
SELECT obj.Name as SPName,
modu.definition as SPDefinition,
obj.create_date as SPCreationDate
FROM sys.sql_modules modu
INNER JOIN sys.objects obj
ON modu.object_id = obj.object_id

WHERE obj.Name = 'stp_tblname'

----------------------------------------------------------------

No comments:

Post a Comment