Displays information about database object dependencies ¾ the views and procedures that depend on the specified table or view, and the tables and views that are depended on by the specified view or procedure.
sp_depends objname
where
Executing sp_depends lists all objects, if any, that depend on objname and all objects, if any, on which objname depends (for example, views depend on one or more tables and can have procedures or other views that depend on them). An object that references another object is considered dependent on that object.
This system stored procedure determines the dependencies by looking at the sysdepends table.
The updated and selected columns in the report from sp_depends are meaningful if the object being reported on is a stored procedure or trigger. The values in these columns indicate whether the stored procedure or trigger updates or selects from that object.
References to objects outside the current database are not reported.
This example lists the database objects that depend on the titles table.
sp_depends titles
Execute permission defaults to the public group.
master.dbo.sp_values, master.dbo.sysdatabases, sysdepends, sysobjects
CREATE PROCEDURE | EXECUTE |
CREATE TABLE | sp_help |
CREATE VIEW |