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

......

 

 

posted on   yjbjingcha  阅读(215)  评论(0编辑  收藏  举报

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示