Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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: 844 | Views in the last 30 days: 1
 
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