Below user-defined stored procedures can be used to get the List of Object Dependencies for a given object.
Method 1
1 2 3 4 5 6 7 |
USE [databasename]; GO CREATE PROCEDURE [dbo].[CheckObjectDependencies](@objectname NVARCHAR(1000)) AS EXEC sp_depends @objectname; |
Method 2
1 2 3 4 5 6 7 8 9 |
USE [databasename]; GO CREATE PROCEDURE [dbo].[CheckObjectDependencies](@objectname NVARCHAR(1000)) AS SELECT * FROM information_schema.routines isr WHERE CHARINDEX(@objectname, isr.ROUTINE_DEFINITION) > 0 |
Leave a Comment