惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 【当耐特】
A
About on SuperTechFans
Last Week in AI
Last Week in AI
雷峰网
雷峰网
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements

博客园 - tohen

浏览器视频文件分段缓存合并成完整的视频 我爷爷吸烟,我爸爸也吸烟,轮到我不能断了香火 线程封装组件(BackgroundWorker)和线程(Thread) SQL2008R2的 遍历所有表更新统计信息 和 索引重建 对比:重建索引与更新统计 试试SQLServer 2014的内存优化表 Sql server2014 内存优化表 本地编译存储过程 SQL Server 2016 查询存储性能优化小结 测试创建表变量对IO的影响 公用表表达式(CTE) 获取应用程序根目录物理路径(Web and Windows) 【别人的老师VS你的老师 】同样是老师,差别怎么这么大呢!? SQL Server 百万级数据提高查询速度的方法 SQL server 数据库备份还原Sql 在计算列中创建索引提高性能 SQL Server读懂语句运行的统计信息 SET STATISTICS TIME IO PROFILE ON SQL Server对Xml字段的操作 为什么洗澡时你会灵感乍现 SQL Server存储过程中使用表值作为输入参数示例
SQL Server 用SSMS查看依赖关系有时候不准确,改用代码查
tohen · 2017-01-02 · via 博客园 - tohen

SQL Server 用SSMS查看依赖关系有时候不准确,明明某个sp中有用到表tohen,查看表tohen的依赖关系的时候,却看不到这个sp

用代码查看方式如下:

--依赖于表tohen的对象
SELECT * FROM sys.dm_sql_referencing_entities('dbo.tohen','OBJECT')
--存储过程sp_tohen依赖的对象
SELECT distinct referenced_entity_name FROM sys.dm_sql_referenced_entities('dbo.sp_tohen','OBJECT')

--查看所有对象的依赖关系
SELECT o.name, o.type_desc, p.name as referenced_name, p.type_desc type_desc2 
FROM sys.sql_expression_dependencies d
INNER JOIN sys.objects o ON d.referencing_id = o.object_id
INNER JOIN sys.objects p ON d.referenced_id = p.object_id