SELECT DISTINCT
o.name AS UsedBy
FROM Sys.sysdepends j
JOIN sys.objects o on o.object_id = j.id
JOIN sys.objects d on d.object_id = j.depid
WHERE d.name = 'MyFunctionOrStoredProcedureName'
Friday, August 8, 2008
SQL Server Object Dependencies
Paul Montgomery was kind enough to pass this one on. This is great for seeing what function or stored procedure is used by.
Labels:
SQL Server
Subscribe to:
Post Comments (Atom)
3 comments:
Right click on the procedure... View Dependencies in Mgt Studio works too.
Thanks Dan. I needed the text version because I am pasting the results into Word for research purposes.
Be aware that neither of these methods will catch references embedded in dynamic SQL.
- blindman
Post a Comment