如何了解 SQL Server View 中使用的表?是否有脚本或工具可以让我知道 View 中使用的表并且还可以列出字段?
希望这能解决这个问题。如果没有请告诉我。
请指导!谢谢!
最佳答案
select
cols.*
from
sys.sql_expression_dependencies objs
outer apply sys.dm_sql_referenced_entities ( OBJECT_SCHEMA_NAME(objs.referencing_id) + N'.' + object_name(objs.referencing_id), N'OBJECT' ) as cols
where
objs.referencing_id = object_id('view_name_here')
关于sql - 确定 SQL Server View 中引用的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8308252/