今天是: | 首页 | 营销咨讯 | 推销技巧 | 网络营销 | 论文大全 | 外贸知识 | 市场信息 | 留言咨询 | 论坛 |
最 新 文 章
普通文章解读二八理论和长尾理论在…
普通文章雅虎倒向谷歌被反垄断部门…
普通文章网络视频营销漫路求索
普通文章涂料是否适合网络营销
普通文章IMPACT揭秘网络营销秘诀
普通文章广告也要得民心,令人生厌…
普通文章谷歌在华战略转向中小企业
普通文章博客营销文章写作技巧
普通文章网盛1800万收购中华纺织网
普通文章互联网进入营销阶段
最 新 热 门
普通文章解读二八理论和长尾理论在…
普通文章雅虎倒向谷歌被反垄断部门…
普通文章网络视频营销漫路求索
普通文章涂料是否适合网络营销
普通文章IMPACT揭秘网络营销秘诀
普通文章广告也要得民心,令人生厌…
普通文章谷歌在华战略转向中小企业
普通文章博客营销文章写作技巧
普通文章网盛1800万收购中华纺织网
普通文章互联网进入营销阶段
最 新 推 荐
推荐文章网站策划之栏目策划
推荐文章网络营销--创意致胜 充满“…
推荐文章Web2.0创业者面临艰难选择…
相 关 文 章
  • JSP连接SQL Server 2000系统…

  • win2000server IIS和tomcat5…

  • Tomcat5+Mssql server 2000数…

  • Eclipse 3.0 上配置JSP开发环…

  • 配置Eclpise+tomcat并实现JS…

  • JAVA/JSP学习系列之四(Orion…

  • Jsp&Servelet 学习笔记(1)

  • Jsp&Servelet 学习笔记(2)

  • Jsp&Servelet 学习笔记(3)

  • Jsp&Servelet 学习笔记(4)

  • Q
    您现在的位置: 推销员 >> 网络营销 >> 网站建设 >> 数据库 >> 文章正文
    sql server存储过程、存储函数的加密、解密
    sql server存储过程、存储函数的加密、解密
    作者:佚名 文章来源:www.top-sales.com.cn 点击数: 更新时间:2007-3-22     
    [ 字体:缩小 正常 放大 | 双击自动滚屏 ]
    请选择合适的字体颜色:

    存储过程、存储函数的加密:WITH ENCRYPTION
    <!--[if !supportLineBreakNewLine]-->
    <!--[endif]-->

    CREATE procedure dbo.sp_XML_main

    @table_name nvarchar(260)='',

    @dirname nvarchar(20)=''

    WITH ENCRYPTION

    as

    begin

    ....................................................

    end

    go
     

     

    存储过程、存储函数的解密(以下是一位绝世高人编写的代码)

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_decrypt]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

    drop procedure [dbo].[sp_decrypt]

    GO

     

    /*--破解函数,过程,触发器,视图.仅限于SQLSERVER2000

     

    --作者:J9988--*/

    /*--调用示例

     

        --解密指定存储过程

        exec sp_decrypt 'AppSP_test'

     

        --对所有的存储过程解密

        declare tb cursor for

        select name from sysobjects where xtype='P' and status>0 and name<>'sp_decrypt'

       

        declare @name sysname

        open tb

        fetch next from tb into @name

        while @@fetch_status=0

        begin

            print '/*-------存储过程 ['+@name+'] -----------*/'

            exec sp_decrypt @name

            fetch next from tb into @name

        end

        close tb

        deallocate tb

    --*/

     

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SP_DECRYPT]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

        drop procedure [dbo].[SP_DECRYPT]

    GO

     

    CREATE  PROCEDURE sp_decrypt(@objectName varchar(50))

    AS

    begin

    set nocount on

    --CSDN:j9988 copyright:2004.04.15

    --V3.1

    --破解字节不受限制,适用于SQLSERVER2000存储过程,函数,视图,触发器

    --修正上一版视图触发器不能正确解密错误

    --发现有错,请E_MAIL:CSDNj9988@tom.com

    begin tran

    declare @objectname1 varchar(100),@orgvarbin varbinary(8000)

    declare @sql1 nvarchar(4000),@sql2 varchar(8000),@sql3 nvarchar(4000),@sql4 nvarchar(4000)

    DECLARE  @OrigSpText1 nvarchar(4000),  @OrigSpText2 nvarchar(4000) , @OrigSpText3 nvarchar(4000), @resultsp nvarchar(4000)

    declare  @i int,@status int,@type varchar(10),@parentid int

    declare @colid int,@n int,@q int,@j int,@k int,@encrypted int,@number int

    select @type=xtype,@parentid=parent_obj from sysobjects where id=object_id(@ObjectName)

     

    create table  #temp(number int,colid int,ctext varbinary(8000),encrypted int,status int)

    insert #temp SELECT number,colid,ctext,encrypted,status FROM syscomments  WHERE id = object_id(@objectName)

    select @number=max(number) from #temp

    set @k=0

     

    while @k<=@number

    begin

    if exists(select 1 from syscomments where id=object_id(@objectname) and number=@k)

    begin

    if @type='P'

    set @sql1=(case when @number>1 then 'ALTER PROCEDURE '+ @objectName +';'+rtrim(@k)+' WITH ENCRYPTION AS '

                              else 'ALTER PROCEDURE '+ @objectName+' WITH ENCRYPTION AS '

    文章录入:admin    责任编辑:admin 
  • 上一个文章:

  • 下一个文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 关于我们 | 友情链接 | 版权申明 |