sql server 搜存储过程关键字.

create PROCEDURE [dbo].[_searchSP]
@keywords nvarchar(100)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

select b.name
from dbo.syscomments a, dbo.sysobjects b
where a.id=b.id and b.xtype='p' and a.text like '%' + @keywords+ '%'
order by name
END

go

create PROCEDURE [dbo].[_searchTableFunction]
@keywords nvarchar(100)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

select b.name
from dbo.syscomments a, dbo.sysobjects b
where a.id=b.id and b.xtype='TF' and a.text like '%' + @keywords+ '%'
order by name
END

GO

posted @ 2014-04-22 18:21  bert.zeng  阅读(186)  评论(0)    收藏  举报