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:
- All parameters are optional.
- @sp_name and @sp_owner support wildcard pattern matching (underscore “_“, percent “%” and brackets []).
- @sp_qualifier it will have null or current database name only.
- @fUsePattern, it can be 0 (wildcard pattern matching is off) or 1 (wildcard pattern matching is on), by default it is 1.
Examples:
- To see complete list of all stored procedures in current database
EXEC SP_STORED_PROCEDURES - To see complete list of procedures, procedure name starting with “fn” characters
EXEC SP_STORED_PROCEDURES @sp_name = 'fn%' - 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%'
No comments:
Post a Comment