create view v_rand
as
select c=unicode(cast(round(rand()*
go
create function f_jmstr(@str varchar(
/*
*參數說明
*str:要加密的字符串或已經加密後的字符
*type:操作類型
*返回值說明
*當操作類型為加密時(type
*當操作類型為解密時(type
*/
As
begin
declare @re varchar(
declare @c int
declare @i int
/*
*加密方法為原字符異或一個隨機ASCII字符
*/
if @type=
begin
select @c=c
while @i>
select @re=nchar(unicode(substring(@str
set @re=@re+nchar(@c)
end
else
begin
select @i=len(@str)
while @i>
select @re=nchar(unicode(substring(@str
end
return(@re)
end
go
declare @tempstr varchar(
set @tempstr=
select dbo
輸出結果
(完)
From:http://tw.wingwit.com/Article/os/xtgl/201311/9139.html