Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query to return stored procedure into
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00742008
Message ID:
00742936
Views:
19
Thanks Mike, more or less the same results with much less code. I appreciate your assistance.

Al


>Does this give you what you need?
>
>
>-- stored procedures and their parameters
>SELECT
>	r.specific_name AS [storedProcedure]
>	, p.parameter_name AS [parameter]
>	, p.data_type AS [datatype]
>	, p.parameter_mode AS [direction]
>FROM
>	information_schema.routines r
>	INNER JOIN information_schema.parameters p ON p.specific_name = r.specific_name
>ORDER BY
>	r.specific_name,
>	p.ordinal_position
>
>-- stored procedures and the tables that they reference
>SELECT DISTINCT
>	object_name(id) AS [storedProcedure]
>	,object_name(depid) AS [referencedTable]
>FROM
>	sysdepends
>WHERE
>	OBJECTPROPERTY(id, 'IsProcedure') = 1
>	AND OBJECTPROPERTY(depid, 'IsUserTable') = 1
>
>
>Just realize that the dependency information is only as valid as the sysdepends table. SQL Server does not force this table to be up to date. You can create a stored procedure that references a table which does not exist. In this situation, SQL Server will not create a row in sysdepends. When the table is created, SQL Server will NOT add the row to sysdepends until the stored procedure is recreated.
>
>-Mike
>
>
Al Williams

Anola MB, CANADA
Previous
Reply
Map
View

Click here to load this message in the networking platform