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

时间:2015-01-13 15:34:03   收藏:0   阅读:254
--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%‘

  

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!