Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Stored procedures

Status
Not open for further replies.

Erics44

Programmer
Oct 7, 2004
133
GB
hI
Does anyone know how i can list the names of my stored procedures in a table/view? I know how to use the information schema for the tables and views.
Thanks in advance
 
Thanks
Having tried it out it works exactly how I need, do you know how I would list the input and return variables for each procedure/function?
 
SELECT
p.[name] ProcName,
c.[name] InputParam,
t.[name] DataType,
t.length Length
FROM sysobjects p
JOIN syscolumns c ON
p.[id] = c.[id]
JOIN systypes t ON
c.xtype = t.xtype
WHERE p.xtype = 'p'
AND p.[name] NOT LIKE 'dt_%'
AND t.[name] NOT LIKE 'sysname'

/*** will not work in SQL 2005 ***/
 
Sorry, it works in SQL 2005 also. I thought Microsoft has changed the system table schema in 2005. Anyway it is good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top