Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 個資ÁÏÁÐÊܵ½Ó°響 )
*/
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/roy_88/archive/2009/11/12/4801917.aspx


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

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 ......

sql serverÇå³ýÈÕÖ¾

1: ɾ³ýLOG (ɾ³ýlogÎļþ£¬¸½¼Óʱ×Ô¶¯Öؽ¨logÎļþ£¬ÒÔ´Ë·½Ê½À´Çå¿ÕÈÕÖ¾)
    1) ·ÖÀëÊý¾Ý¿â  ÆóÒµ¹ÜÀíÆ÷£­£¾·þÎñÆ÷£­£¾Êý¾Ý¿â£­£¾ÓÒ¼ü£­£¾·ÖÀëÊý¾Ý¿â
    2) ɾ³ýLOGÎļþ
    3) ¸½¼ÓÊý¾Ý¿â  ÆóÒµ¹ÜÀíÆ÷£­£¾·þÎñÆ÷£­£¾Êý¾Ý¿â£­£¾ÓÒ¼ü£­£¾¸½¼ÓÊý¾Ý¿â
´Ë·¨Éú³ ......

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)--這Àï¿É轉換 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ