There are various methods to finds the dependent objects , there is a system defined procedures sp_depends but it does not give perfect result always as it give results on the basis of creation order, more accurate ways are below
If we need to find paymentdetail table dependency on procedures/objects ,then query
If we need to find paymentdetail table dependency on procedures/objects ,then query
FIND Dependency
SELECT DISTINCT so.name
FROM sys.syscomments sc
INNER JOIN sys.sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%paymentdetail%'
ORSELECT
referencing_schema_name, referencing_entity_name,
referencing_id, referencing_class_desc, is_caller_dependent
FROM
sys.dm_sql_referencing_entities (
'dbo.First'
,
'OBJECT'
);
FIND Text in Procedures
select name from sys.procedures
where OBJECT_DEFINITION(OBJECT_ID) like '%paymentdetail%'