SQL SERVER 查看所有存储过程或视图里 包含某个关键字的查询语句

select name,
       type_desc
from   sys.all_sql_modules s
       inner join sys.all_objects o on s.object_id = o.object_id
where  definition like '%关键字%'
order by type_desc, name;
select name, xtype from sysobjects o, syscomments s
where o.id = s.id and text like '%agent%';
--查询所有包含某列名的对象
select name,
       object_id,
       type,
       type_desc
from sys.objects
where object_id in (
                       select object_id from sys.columns where name = 'serverid'
                   );

 

(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐