Is there a way to query the database and retrieve a list of all stored procedures and their parameters?
I am using SQL Server 2000.
views:
28answers:
2
+1
Q:
How do I get the list of all stored procedures and their parameters starting with a certain prefix?
+2
A:
To get information on the stored procedures:
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
To find the sprocs starting with a certain prefix (e.g. "usp"):
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME LIKE 'usp%'
To find all the parameters for a stored procedure:
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME='YourSprocName'
To find all the parameters for all stored procedures starting with a certain prefix:
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE SPECIFIC_NAME LIKE 'usp%'
AdaTheDev
2010-02-28 11:42:55
+1. However, thing about the requested prefix.
Obalix
2010-02-28 11:56:28
Should I change the WHERE SPECIFIC_NAME = ... to LIKE "MyTable_*"?
the_drow
2010-02-28 11:59:52
Updated my answer with 2 further examples, to search by a certain prefix.
AdaTheDev
2010-02-28 12:02:28
A:
try this one :
select o.name,p.name from sys.all_parameters p inner join sys.all_objects o on p.object_id = o.object_id
where o.type = 'P'
masoud ramezani
2010-02-28 12:56:40