在 SQL Server 2008 中查找 DB 对象用法的快速方法? [英] Quick way to find usages of DB Objects in SQL Server 2008?

查看:35
本文介绍了在 SQL Server 2008 中查找 DB 对象用法的快速方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像 Alt F1 为您提供有关任何 DB 对象的信息一样.有没有什么快速的方法可以找出所有地方都引用了特定的 db 对象.例如:

Just like Alt F1 gives you information about any DB object., Is there any quick way to find out at what all places is a particular db object refered to. For instance:

-A table used in other stored procs. 
-A stored proc used in other stored procs. 
-A user defined type used as table value parameter in stored procs.

等等...

过去我使用过 Red Gate SQL Search,但我必须在我的公司获得许可才能安装它.

In the past i have used Red Gate SQL Search but i will have to take permission here at my company to install it.

查询也可以.

推荐答案

2008 年的依赖项信息比以前的版本更强大,因为在以错误"顺序创建对象时,您不再会永久丢失依赖项信息.

The dependencies information is a lot more robust in 2008 than previous versions as you no longer get permanently missing dependency info when creating objects in the "wrong" order.

从在线图书中窃取示例

SELECT referencing_schema_name, 
       referencing_entity_name, 
       referencing_id, 
       referencing_class_desc, 
       is_caller_dependent
FROM sys.dm_sql_referencing_entities ('Production.Product', 'OBJECT');

这篇关于在 SQL Server 2008 中查找 DB 对象用法的快速方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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