什么是Sql Query来查找为Sql server 2005中的所有表调用的存储过程? [英] What is the Sql Query to find Stored procedure called for which all tables in Sql server 2005?

查看:59
本文介绍了什么是Sql Query来查找为Sql server 2005中的所有表调用的存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查找Sql server 2005中所有表的Sored Query是什么?

解决方案

   -     - 选项1  
SELECT DISTINCT so.name
FROM syscomments sc
INNER JOIN sysobjects so span class =code-keyword> ON sc.id = so.id
WHERE sc。 TEXT LIKE ' %tablename%'
- - 选项2
SELECT DISTINCT o.name,o.xtype
FROM syscomment sc
INNER JOIN sysobjects o ON c.id = o.id
WHERE c。 TEXT LIKE ' %tablename%'


What is the Sql Query to find Stored procedure called for which all tables in Sql server 2005?

解决方案

----Option 1
SELECT DISTINCT so.name
FROM syscomments sc
INNER JOIN sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%tablename%'
----Option 2
SELECT DISTINCT o.name, o.xtype
FROM syscomments c
INNER JOIN sysobjects o ON c.id=o.id
WHERE c.TEXT LIKE '%tablename%'


这篇关于什么是Sql Query来查找为Sql server 2005中的所有表调用的存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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