65.9K
CodeProject is changing. Read more.
Home

Query that returns list of all Stored Procedures in an MS SQL database

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.07/5 (6 votes)

Jan 16, 2015

CPOL
viewsIcon

73526

Query that returns list of all Stored Procedures

How to Get List of all Stored Procedures in an MS SQL database.

Solution 1

select *  from YourDatabaseName.information_schema.routines 
 where routine_type = 'PROCEDURE'

Solution 2

select *   from YourDatabaseName.information_schema.routines 
 where routine_type = 'PROCEDURE' 
   and Left(Routine_Name, 3) NOT IN ('sp_', 'xp_', 'ms_')

Note: retrun Prodecdure Name Not Start from 'sp_', 'xp_', 'ms_'

Solution 3

SELECT name, type   FROM dbo.sysobjects
 WHERE (type = 'P')

 

Thanks