如何查找影响特定列的存储过程列表? [英] How to Find the list of Stored Procedures which affect a particular column?

查看:32
本文介绍了如何查找影响特定列的存储过程列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究这个大型数据库,它在 SP 中嵌入了很多业务知识[我知道!] 并且在 SP 之间有很多链接.即一个存储过程调用另一个.

Im working on this large DB which has a lot of the business knowledge embedded in the SPs[I know!] and there is a lot of chaining between the SPs. i.e one stored proc calling another.

我想找出更新特定列的存储过程列表.我该怎么做.

Im want to find out a list of stored procedures which update a particular column. How would I do that.

使用 showplan_All 如中所述用于存储过程的 SQL 表和列解析器 对我不起作用,因为这是一个共享的开发数据库.

Using showplan_All as outlined in SQL Table and column Parser for stored procedures doesnt work for me, because this is a shared dev db.

如上所述使用来自主数据库扫描系统文本的 Sp 是不可行的,因为我无权访问主数据库.

using a Sp from master db scanning system text as described is not feasible because I dont have access to the master db.

那么我如何才能找到这些信息?

So how can I find this informaion?

推荐答案

您是否尝试过:EXEC sp_depends @objname = [您感兴趣的列的表名].

例如,如果您在名为 Product 的表中有一个名为 Price 的列,您将执行以下操作:EXEC sp_depends @objname = N'Product'.

So for example, if you had a column named Price in a table named Product, you would execute this: EXEC sp_depends @objname = N'Product'.

只需执行此操作即可为您提供依赖于该特定表的所有 sps、视图等的列表.

Simply executing this would give you list of all sps, views, etc which depend on that particular table.

我一直在使用它,因为我使用的数据库有 400 多个表:-)

I use this all the time as I work with a db which has over 400 tables :-)

MSDN 上的 sp_depends 页面

这篇关于如何查找影响特定列的存储过程列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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