Sql Server 查看所有存储过程或视图的位置及内容

select a.name,a.[type],b.[definition] from sys.all_objects a,sys.sql_modules b
where a.is_ms_shipped=0 and a.object_id = b.object_id and a.[type] in ('P','V','AF')
order by a.[name] asc

通过这个sql语句可以查到sql server中的视图和存储过程的内容及位置,然后再用where过滤得到,你想要的结果

posted @ 2014-06-13 13:57  花&JO  阅读(459)  评论(0编辑  收藏  举报