是否有查詢來獲取我的表所依賴的表的列表?我已經試過sys.sql_expression_dependencies
,sys.dm_sql_referencing_entities
,sp_depends, information_schema.routines
。我的表依賴於sql服務器的對象
這給依賴於我的表的對象。這是我曾嘗試查詢:
sp_depends 'dbo.buyer'
SELECT *
FROM information_schema.routines ISR
WHERE CHARINDEX('dbo.buyer', ISR.ROUTINE_DEFINITION) > 0
SELECT OBJECT_NAME(referencing_id),* FROM sys.sql_expression_dependencies
WHERE referencing_id = OBJECT_ID('dbo.buyer')
SELECT OBJECT_NAME(referencing_id),* FROM
ims.sys.sql_expression_dependencies
WHERE referenced_id = OBJECT_ID('ims.dbo.buyer');
SELECT referencing_schema_name, referencing_entity_name,
referencing_id, referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('dbo.buyer', 'OBJECT')