Monday, March 12, 2012

List all Stored Procedure Names and Scripts in the database.

 

Below SQL query can be used to display all Stored Procedures and SQL Scripts used to create those Stored Procedure in your database.

SELECT  sysObj.Name as [Stored Procedure Name], sysM.Definition as [Stored Procedure Script]
FROM sys.sql_modules as sysM INNER JOIN sys.objects as sysObj 
ON sysM.object_id = sysObj.object_id 
WHERE sysObj.type = 'P'

If you need more sample please refer my articles: Stored Procedures

No comments: