易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL文加密

use Tempdb
go
if object_ID('fn_ACITEncryption') is not null
drop function fn_ACITEncryption
go
create function fn_ACITEncryption
(
@Str nvarchar(4000),--加密的字符串
@Flag bit=1,--1、加密 0、解密
@Key nvarchar(50)--密文
)
returns nvarchar(4000)--這里可轉換成二進制
with Encryption
as
begin
Declare @LenStr int,@i int,@Str2 nvarchar(4000),@Split nvarchar(2),@LenKey int
select @Str=@Str+'A',@LenStr=len(@Str),@i=1,@Str2='',@LenKey=Len(@Key+'A')-1
while @i<@LenStr
select @Split=substring(@Str,@i,1),
@Split=nchar((unicode(@Split)+case @Flag when 1 then unicode(substring(@Key+'A',@i%@LenKey+1,1))-1
when 0 then 65535-unicode(substring(@Key+'A',@i%@LenKey+1,1))
else 0 end)%65535+cast(@Flag as int)),
@Str2=@Str2+@Split,@i=@i+1
return @Str2
end
go
select dbo.fn_ACITEncryption(N'Roy',1,'123') as 加密后字符串
/*
加密后字符串
------------------------------
㢻
(1 個資料列受到影響)
*/
select dbo.fn_ACITEncryption(N'„¢ª',0,'123') as 解密后字符串
/*
解密后字符串
--------------------------
Roy
(1 個資料列受到影響)
*/


相关文档:

Interbase/Firebird的SQL语法(收藏)

最近在群里大家突然讨论下fb(firebird)来了,呵,看了一些资料,突然发觉这个东西也蛮好玩的,于是开始大量的查找有关的资料,下面是一
些fb下的sql写法,转自网上,各位朋友将就些看看吧,过几天偶整理好.net下使用fb的demo上来给大家看看吧,到时支持支持吧,呵呵
一、分页写法小例:
  SELECT FIRST
10 templa ......

sql server无法连接 issue

http://blog.csdn.net/java2000_net/archive/2008/04/05/2252640.aspx
http://sqlserver.chinahtml.com/2006/SQL-mssql11432786154012.shtml
http://www.cnblogs.com/garnai/archive/2007/09/19/898221.html
http://tech.ccidnet.com/art/1099/20050223/214511_1.html
http://www.wangchao.net.cn/bbsdetail_43009.html ......

oracle常用经典SQL查询(转载)

常用SQL查询:
1、查看表空间的名称及大小
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
2、查看表空间物理文件的名称及大小
select tablespace_name, file_id, ......

在Delphi中拼装SQL语句的注意点

我使用delphi也不是很长时间,由于经常要用到SQL语句,总结了一些Delphi中使用SQL语句要注意的事项,归纳起来主要有一下几条:
一、空格不要漏:
我们经常要拼装SQL语句,特别是where条件句,在各个语句中别忘了头尾加上空格。因为在一个语句中我们会注意用空格分开关键字但是往往忘了头尾的空格。例如:
sSQL=' select ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号