Sql server中依据存储过程中的部分信息查找存储过程名称的方法【视图和Function】

1、查询的语句:

select a.id,b.name,a.*,b.* from syscomments a
join sysobjects b on a.id=b.id
where b.xtype='P' and a.text like '%usp_cm%'

b.xtype='P'指定在什么类型的范围进行搜索

‘%usp_cm%’就是你能记得的存储过程中的内容。

2、查找类型:

select distinct xtype from sysobjects

找到数据库中全部的对象类型

P是存储过程

V是视图

FN是function

U是Table

......

 

 

【推广】 免费学中医,健康全家人
原文地址:https://www.cnblogs.com/yjbjingcha/p/8410200.html