日期:2014-05-18  浏览次数:20460 次

如何查找:哪些存储过程中包含字段(或字符)?
数据库里写了很多存储过程,想用SQL语句查出哪些存储过程包含字段(如:user_id)

------解决方案--------------------
[code=SQLl]
select * from sys.objects s where s.type='p' and s.name like '%user_id%'

[/code]
------解决方案--------------------
[code=SQ]Lselect name from sysobjects where id in (select id from syscomments where text like '%user_id%')[/code]
------解决方案--------------------
我用的方法是tasks里把所有存储过程保存出来,然后用nodpad++打开搜索。。。