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

  • 相关阅读:
    Redis 简介
    图片懒加载、selenium和PhantomJS
    Python网络爬虫之三种数据解析方式
    Scrapy框架之CrawlSpider
    Scrapy 框架
    python 网络爬虫概念与HTTP(s)协议
    Mysql概念及基本操作
    Python re 模块
    线程与进程应用场景
    全局解释器锁 GIL
  • 原文地址:https://www.cnblogs.com/emanlee/p/1673805.html
Copyright © 2011-2022 走看看