sp_depends
Displays information about database object dependencies (for example, the views and procedures that depend on a table or view, and the tables and views that are depended on by the view or procedure). References to objects outside the current database are not reported.
Syntax
sp_depends [ @objname = ] 'object'
Arguments
[@objname =] 'object'
The database object to examine for dependencies. The object can be a table, view, stored procedure, or trigger. object is nvarchar(776), with no default.
Return Code Values
0 (success) or 1 (failure)
Result Sets
sp_depends displays two result sets.
Remarks
An object that references another object is considered dependent on that object. sp_depends determines the dependencies by looking at the sysdepends table.
Permissions
Execute permissions default to the public role.
Examples
This example lists the database objects that depend on the Customers table.
USE Northwind
EXEC sp_depends 'Customers'