码迷,mamicode.com
首页 > 其他好文 > 详细

SQL查找存储过程,列名,表,方法,字符串中匹配的字符串

时间:2018-07-02 11:49:46      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:字符   type   and   select   com   where   view   bit   IV   

--select string using in procedure
select b.name, a.text from syscomments a left join sysobjects b on b.id=a.id
where b.xtype=‘P‘ and a.text like ‘%USP_FOUNDATIONUPDATE%‘


--select columns name
select b.name as Table1, a.name as Columns1,a.type  from syscolumns a left join sysobjects b on b.id=a.id
where b.xtype=‘u‘ and a.name like ‘%season%‘

 

--select table name
select name from sysobjects where xtype=‘u‘ and name like ‘%habit%‘


--select string using in function
select b.name, a.text from syscomments a left join sysobjects b on b.id=a.id
where b.xtype=‘fn‘ and a.text like ‘%Fn_GetIR%‘


--select string using in view
select b.name, a.text from syscomments a left join sysobjects b on b.id=a.id
where b.xtype=‘V‘ and a.text like ‘%vw_species%‘

	

  

SQL查找存储过程,列名,表,方法,字符串中匹配的字符串

标签:字符   type   and   select   com   where   view   bit   IV   

原文地址:https://www.cnblogs.com/Aaron-Lee/p/9252966.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!