SQL Server 依赖项 [英] SQL Server Dependencies

查看:27
本文介绍了SQL Server 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法可以在 SQL Server 2005+ 中查找表/存储过程/函数依赖项?我继承了一个巨大的应用程序,它有很多表,甚至更多的长且相互关联的存储过程和函数.

Is there an easy way to chase down table/stored procedure/function dependencies in SQL Server 2005+? I've inherited a giant application with lots of tables and even more stored procedures and functions that are long and interlinked.

归根结底,有没有办法构建依赖树?理想情况下,我要寻找的是双向的:

At the end of the day is there a way to build a dependency tree? Ideally what I'm looking for goes in both directions:

对于表/过程 - 什么依赖于它?:向我展示最终引用它的所有存储过程(最好在树视图中,以便子过程嵌套到调用他们)

For a table/procedure - what depends ON it?: Show me all the stored procedures that eventually reference it (ideally in a tree view such that sub procedures nest out to the bigger procedures that call them)

对于过程 - IT 依赖什么?:显示给定过程在运行时将(或可能)触及的所有过程和表格.

For a procedure - what does IT depend on?: Show me all the procedures and tables that a given procedure will (or could) touch when running.

看起来这个工具应该不难制作,而且对于数据库维护通常非常有用.有没有人知道这样的事情?如果这不存在,为什么不呢?

It seems this tool shouldn't be that hard to make and would be incredibly useful for DB maintenance generally. Is anyone aware of such a thing? If this doesn't exist, why the heck not?

Management Studio 中的内置功能很好,但信息似乎根本不完整.

The built-in functionality in Management Studio is nice but the information does not appear to be complete at all.

推荐答案

Red Gate 有一个非常有用的工具,叫做 SQL 依赖跟踪器.我们已经成功地将它用于您希望获得的结果类型.

Red Gate has a pretty useful tool called SQL Dependency Tracker. We've successfully used it for the type of results you're wishing to obtain.

这篇关于SQL Server 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆