begin
set @origsptext1=(select ctext from #temp where colid=@n)
set @objectname1=@objectname+'_t'
set @origsptext3=(select ctext from syscomments where id=object_id(@objectname) and colid=@n)
if @n=1
begin
set @origsptext2='create procedure '+ @objectname +' with encryption as '--
set @q=4000-len(@origsptext2)
set @origsptext2=@origsptext2+replicate('-',@q)
end
else
begin
set @origsptext2=replicate('-', 4000)
end
--start counter
set @i=1
--fill temporary variable
set @resultsp = replicate(n'a', (datalength(@origsptext1) / 2))
--loop
while @i<=datalength(@origsptext1)/2
begin
--reverse encryption (xor original+bogus+bogus encrypted)
set @resultsp = stuff(@resultsp, @i, 1, nchar(unicode(substring(@origsptext1, @i, 1)) ^
(unicode(substring(@origsptext2, @i, 1)) ^
unicode(substring(@origsptext3, @i, 1)))))
set @i=@i+1
end
--drop original sp
--execute ('drop procedure '+ @objectname)
--remove encryption
--preserve case
set @resultsp=replace((@resultsp),'with encryption', '')
set @resultsp=replace((@resultsp),'with encryption', '')
set @resultsp=replace((@resultsp),'with encryption', '')
if charindex('with encryption',upper(@resultsp) )>0
set @resultsp=replace(upper(@resultsp),'with encryption', '')
--replace stored procedure without enryption
print @resultsp
--execute( @resultsp)
set @n=@n+1
end
drop table #temp
rollback transaction
end
解密SQL2000的儲存過程
內容來自網際網路,作者不明 drop procedure sp decrypt gocreate procedure sp decrypt objectname varchar 50 asbegin begin transaction add by playyuer declare objectna...
sql2000儲存過程
自 http www.cnblogs.com a13971240 archive 2008 10 22 1316747.html create proc getdataset tablelist varchar 200 搜尋表的字段,比如 id,datatime,job 用逗號隔開 tablenam...
sql2000儲存過程
create proc getdataset tablelist varchar 200 搜尋表的字段,比如 id,datatime,job 用逗號隔開 tablename varchar 30 搜尋的表名 selectwhere varchar 500 搜尋條件,這裡不用寫where,比如 job...