--查找存在某表名的存储过程
SELECT distinct b.name from syscomments a,sysobjects b
WHERE a.id=b.id and a.TEXT LIKE '%你要查找的表名%'
--查找存在某内容的存储过程
SELECT NAME FROM sysobjects o, syscomments s
WHERE o.id = s.id
AND TEXT LIKE '%你要查找的内容%'
AND o.xtype = 'P'
--查询表中一个字段用逗号分隔的结果集
select LEFT(t,LEN(t)-1) from ( select (select CAST(group_module AS varchar(255)) +' ,' from group_module where 1=1 for xml path('')) as t) temp;
网友评论