zoukankan      html  css  js  c++  java
  • SQL Server在存储过程中查找关键字

    在存储过程中查找(搜索,查询)关键字

    SQL 查找存储过程中出现过的文字怎么查询呢?

    select b.name
    from 数据库名.dbo.syscomments a, 数据库名.dbo.sysobjects b
    where a.id=b.id  and b.xtype='p' and a.text like '%key words%'

    order by name

    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

  • 相关阅读:
    Application和Page详解
    Session解析
    CSS设置技巧
    CSS布局模型
    CSS盒模型
    JAVA -Xms -Xmx -XX:PermSize -XX:MaxPermSize 区别
    设计模式——单例模式
    设计模式——工厂模式
    Go语言学习
    每周一个设计模式
  • 原文地址:https://www.cnblogs.com/emanlee/p/1673805.html
Copyright © 2011-2022 走看看