首页 > 数据库技术 > 详细

SQL 查询某个表被哪些存储过程使用到

时间:2015-01-13 15:34:03      阅读:254      评论:0      收藏:0      [点我收藏+]
--1.查询某个表被哪些存储过程使用到 :
select distinct object_name(id) 
from syscomments 
where id in (select object_id from sys.objects where type =‘P‘) 
and text like‘%TableName%‘

 
--2.查找那些过程对该表做了更新操作:
select distinct object_name(id) 
from syscomments 
where id in(select object_id from sys.objects where type =‘P‘) 
and text like‘%update tablename%‘

  

SQL 查询某个表被哪些存储过程使用到

原文:http://www.cnblogs.com/valeb/p/4221287.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!