Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

How to get list of Stored Procedure

By Tariq,

You can use following stored procedure with four optional input parameters to get a list of all stored procedures in the current environment.

EXEC SP_STORED_PROCEDURES @sp_name = 'procedure name'
, @sp_owner = 'schema name'
, @sp_qualifier = 'database name'
, @fUsePattern = 'fUsePattern'

Note:
1. All parameters are optional.
2. @sp_name and @sp_owner support wildcard pattern matching (underscore "_", percent "%" and brackets []).
3. @sp_qualifier it will have null or current database name only.
4. @fUsePattern, it can be 0 (wildcard pattern matching is off) or 1 (wildcard pattern matching is on), by default it is 1.

Examples:
1. To see complete list of all stored procedures in current database
EXEC SP_STORED_PROCEDURES
2. To see complete list of procedures, procedure name starting with "fn" characters
EXEC SP_STORED_PROCEDURES @sp_name = 'fn%'
3. To see complete list of procedure, procedure name starting with "fn" and schema name starting with "s" characters
EXEC SP_STORED_PROCEDURES @sp_name = 'fn%', @sp_owner = 's%'

 

Total article views: 791 | Views in the last 30 days: 6
 
Related Articles
FORUM

currently running stored procedure name

currently running stored procedure name

FORUM

stored procedures in a database

stored procedures in a database

FORUM

Store Procedure

Store Procedure

FORUM

Searching complete database

Searching complete database

FORUM

Stored Procedure Intermittent Problems

Stored Procedure does not always complete

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones