As a DBA or Database Developer, you guys many times require to find object dependency into the current database.
Finding the Object Dependency is very useful before you go to alter or drop particular object.
Below is three reference script to find object dependency. You can use any one as per your requirements.
WHERE DEFINITION LIKE '%tbl_Employee%'
,SO.XType AS ObjectType
,SC.TEXT AS ObjectDefinition
FROM syscomments AS SC
INNER JOIN sysobjects AS SO ON SC.id=SO.id
WHERE SC.TEXT LIKE '%tablename%'
referencing_schema_name, referencing_entity_name, referencing_id,
sys.dm_sql_referencing_entities ('SchemaName.TableName', 'Object');
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.