This Domain(Admin5.com) is for Sale:

SqlServer数据库存储过程函数加解密

时间:2007-12-23  来源:不详  作者:迈克DB

select @tr_parent_xtype=xtype from sysobjects where id=@parent_obj

织梦好,好织梦

if @tr_parent_xtype='V' 内容来自dedecms

begin

本文来自织梦

set @sql1='ALTER TRIGGER ' @objectname ' ON ' OBJECT_NAME(@parentid) ' WITH ENCRYPTION INSTERD OF INSERT AS PRINT 1 '

end

织梦内容管理系统

else 织梦内容管理系统

begin copyright dedecms

set @sql1='ALTER TRIGGER ' @objectname ' ON ' OBJECT_NAME(@parentid) ' WITH ENCRYPTION FOR INSERT AS PRINT 1 ' 织梦好,好织梦

end

dedecms.com

end 内容来自dedecms

if @type='FN' or @type='TF' or @type='IF' 织梦内容管理系统

set @sql1=(case @type when 'TF' then

dedecms.com

'ALTER FUNCTION ' @objectName '(@a char(1)) returns @b table(a varchar(10)) with encryption as begin insert @b select @a return end ' 织梦内容管理系统

when 'FN' then 织梦内容管理系统

'ALTER FUNCTION ' @objectName '(@a char(1)) returns char(1) with encryption as begin return @a end'

内容来自dedecms

when 'IF' then

织梦内容管理系统

'ALTER FUNCTION ' @objectName '(@a char(1)) returns table with encryption as return select @a as a'

织梦好,好织梦

end) dedecms.com


if @type='V'

dedecms.com

set @sql1='ALTER VIEW ' @objectname ' WITH ENCRYPTION AS SELECT 1 as f'


set @q=len(@sql1)

织梦好,好织梦

set @sql1=@sql1 REPLICATE('-',4000-@q) 织梦好,好织梦

select @sql2=REPLICATE('-',8000) copyright dedecms

set @sql3='exec(@sql1'

内容来自dedecms

select @colid=max(colid) from #temp where number=@k

织梦内容管理系统

set @n=1 内容来自dedecms

while @n<=CEILING(1.0*(@colid-1)/2) and len(@sQL3)<=3996

织梦内容管理系统

begin dedecms.com

set @sql3=@sql3 ' @'

织梦好,好织梦

set @n=@n 1 dedecms.com

end 本文来自织梦

set @sql3=@sql3 ')'

copyright dedecms

exec sp_executesql @sql3,N'@sql1 nvarchar(4000),@ varchar(8000)',@sql1=@sql1,@=@sql2 dedecms.com

end

内容来自dedecms

set @k=@k 1

copyright dedecms

end 内容来自dedecms


set @k=0 织梦好,好织梦

while @k<=@number 内容来自dedecms

begin 内容来自dedecms

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

begin 织梦好,好织梦

select @colid=max(colid) from #temp where number=@k

本文来自织梦

set @n=1 copyright dedecms


while @n<
=@colid

copyright dedecms

begin dedecms.com

select @OrigSpText1=ctext,@encrypted=encrypted,@status=status FROM #temp WHERE colid=@n and number=@k 内容来自dedecms


SET @OrigSpText3=(SELECT ctext FROM syscomments WHERE id=object_id(@objectName) and
colid=@n and number=@k)

if @n=1 织梦好,好织梦

begin

内容来自dedecms

if @type='P' 织梦内容管理系统

SET @OrigSpText2=(case when @number>1 then 'CREATE PROCEDURE ' @objectName ';' rtrim(@k) ' WITH ENCRYPTION AS ' 内容来自dedecms

else 'CREATE PROCEDURE ' @objectName ' WITH ENCRYPTION AS ' copyright dedecms

end) 本文来自织梦


if @type='FN' or @type='TF' or @type='IF' 内容来自dedecms

SET @OrigSpText2=(case @type when 'TF' then

内容来自dedecms

'CREATE FUNCTION ' @objectName '(@a char(1)) returns @b table(a varchar(10)) with encryption as begin insert @b select @a return end ' 织梦好,好织梦

when 'FN' then 织梦内容管理系统

'CREATE FUNCTION ' @objectName '(@a char(1)) returns char(1) with encryption as begin return @a end' dedecms.com

when 'IF' then

dedecms.com

'CREATE FUNCTION ' @objectName '(@a char(1)) returns table with encryption as return select @a as a'

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息