use EDW_PreSource
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')
and b.[definition] like '%your keywords%' -- db fields,dbName etc
order by a.[name] asc

本文介绍了一个SQL查询示例,该查询用于从数据库中检索包含特定关键字的所有存储过程和视图的定义。通过筛选非系统对象并针对不同类型的数据库对象进行搜索,此脚本有助于快速定位所需的数据库对象。

被折叠的 条评论
为什么被折叠?



