当前位置:
凯发ag旗舰厅登录网址下载 >
运维知识
> 数据库
>内容正文
数据库
sqlserver存储过程/函数加/解密(轉) -凯发ag旗舰厅登录网址下载
凯发ag旗舰厅登录网址下载
收集整理的这篇文章主要介绍了
sqlserver存储过程/函数加/解密(轉)
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
存储过程、存储函数的加密:with encryption
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-- all rights reserved*/
/*--调用示例
--解密指定存储过程
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
--破解字节不受限制,适用于sqlserver2000存储过程,函数,视图,触发器
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-- all rights reserved*/
/*--调用示例
--解密指定存储过程
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
--破解字节不受限制,适用于sqlserver2000存储过程,函数,视图,触发器
转载于:https://www.cnblogs.com/fosoyo/archive/2006/09/28/516967.html
总结
以上是凯发ag旗舰厅登录网址下载为你收集整理的sqlserver存储过程/函数加/解密(轉)的全部内容,希望文章能够帮你解决所遇到的问题。
如果觉得凯发ag旗舰厅登录网址下载网站内容还不错,欢迎将凯发ag旗舰厅登录网址下载推荐给好友。
- 上一篇:
- 下一篇: