首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

sql md5加密函数如何应用啊

2012-03-26 
sql md5加密函数怎么应用啊?我在sql的查询分析器里面运行了下面网址的语句http://dev-club.esnai.com/club

sql md5加密函数怎么应用啊?
我在sql   的查询分析器里面运行了下面网址的语句

http://dev-club.esnai.com/club/bbs/showEssence.asp?id=23513&page=1

现在我要在表的触发器里面应用md5,   该怎么写?

原来是用sql   自带的加密的
CREATE   trigger   AccountInfo_update  
on   AccountInfo  
for   update  
as  
if   update(密码)  
begin  


Update   br  

            Set   br.password=convert(varbinary(64),pwdencrypt(i.密码))
            From   AccountInfo   br   ,   Deleted   d   ,Inserted   i  
            Where   br.Login=d.Login

     
end  




[解决办法]
CREATE trigger AccountInfo_update
on AccountInfo
for update
as
if update(密码)
begin
Update br
Set br.password=dbo.md5(br.密码)
From AccountInfo br , Deleted d ,Inserted i
Where br.Login=d.Login
end
[解决办法]
SQL Server没有dbo.md5()这个函数。

需要自己处理。
[解决办法]
首先用VC开发一个MD5的 ActiveX 控件,注册;
然后在SQL 中编写一个专用的用户SP,调用;
在你应用的地方调用这个SP好了!

热点排行