When developing components for SQL Server one change may affect another database object. Finding these dependent objects should be straightforward, but in most cases it is not as easy as we would think. There are several methods of getting this information, in this article we will have a look using SP_DEPENDS a System Stored Procedure.
exec sp_depends [ @objname = ] '<object>'
The sp_depends shows the following result set of the object depend on <object>.
|Column name||Data type||Description|
|name||nvarchar(257 )||Name of the item for which a dependency exists.|
|type||nvarchar(16)||Type of the item.|
exec [sp_depends] @objname = N'[Details].[StudentPersonalDetails]';
By using SP_DEPENDS system stored procedure, we can view all the object dependencies. This is also one of the approach to find the object dependencies. I assume this tip was very useful. Please share your feedback in the comment section.