Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server / SQL-Server-2008R2

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

4.07/5 (6 votes)
15 Jan 2015CPOL 73.5K  
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 

 

 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)