是否有查询来获取我的表所依赖的表的列表?我已经试过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')