×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: T-SQL
Posted by: tausif alam
Added: Apr 25, 2016 8:41 AM
Views: 7
The following query returns all the name of the stored procedure in the database
  1. As Mike stated, the best way is to use information_schema. As long as you're not in the master database, system stored procedures won't be returned.
  2.  
  3. select *
  4.   from DatabaseName.information_schema.routines
  5.  where routine_type = 'PROCEDURE'
  6. If for some reason you had non-system stored procedures in the master database, you could use the query (this will filter out MOST system stored procedures):
  7.  
  8. select *
  9.   from master.information_schema.routines
  10.  where routine_type = 'PROCEDURE'
  11.    and Left(Routine_Name, 3) NOT IN ('sp_', 'xp_', 'ms_')