sqlserver在存储过程、函数、视图中查询指定内容

select a.name,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')
and definition like '%ProductName%'
order by a.[name] asc

select a.name,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 ('v')
and definition like '%ProductName%'
order by a.[name] asc

select a.name,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 ('f')
and definition like '%ProductName%'
order by a.[name] asc

posted @ 2022-05-19 10:50  葡萄糖  阅读(130)  评论(0)    收藏  举报