Click here to Skip to main content
15,888,351 members
Articles / Database Development / SQL Server / SQL Server 2008R2
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
4.07/5 (6 votes)
15 Jan 2015CPOL 72.9K   7   5
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)


Written By
Software Developer
India India
string currentJob = new ComputerScientist("ND-1550", "02/04", "CDN Solutions");

while (live)
{
try
{
learn();
code();
}
catch (Exception ex)
{
recover();
}
}

Comments and Discussions

 
GeneralMy vote of 4 Pin
Umesh AP3-May-16 3:43
Umesh AP3-May-16 3:43 
All options at one place. Gooood.
AnswerSystem Catalogues Pin
John B Oliver15-Feb-15 10:14
John B Oliver15-Feb-15 10:14 
Generalsp_stored_procedures also return a list of all stored procedures in current context. Pin
Liju Sankar17-Jan-15 8:16
professionalLiju Sankar17-Jan-15 8:16 
GeneralRe: sp_stored_procedures also return a list of all stored procedures in current context. Pin
Wendelius17-Jan-15 9:30
mentorWendelius17-Jan-15 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.