Aqui vamos nós ..
Abra o Query Analyzer MSSQL
Temos certeza de que temos a WZ_MD5_MOD.dll em Ferramentas / / Binn / do nosso SQL Server da Microsoft.
Criando as Alargada md5 procedimentos armazenados para o DB Mestre
Código PHP:
utilizar Master
GO
se existe (selecione * de dbo.sysobjects onde id = object_id (N '[dbo]. [XP_MD5_CheckValue]') e OBJECTPROPERTY (id, N'IsProcedure ') = 1)
cair procedimento [dbo]. [XP_MD5_CheckValue]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
exec sp_addextendedproc N'XP_MD5_CheckValue ', N'WZ_MD5_MOD. dll'
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
se existe (selecione * de dbo.sysobjects onde id = object_id (N '[dbo]. [XP_MD5_EncodeKeyVal]') e OBJECTPROPERTY (id, N'IsProcedure ') = 1)
cair procedimento [dbo]. [XP_MD5_EncodeKeyVal]
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
exec sp_addextendedproc N'XP_MD5_EncodeKeyVal ', N'WZ_MD5_MOD. dll'
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Backup de seu banco de dados. Se você estragar tudo eu nunca vou ouvir o fim de tudo!
Agora vamos criar um campo na tabela MEMB_INFO armazenar senhas em (temporário)
Código PHP:
usar MuOnline
alterar a tabela memb_info add temphash varbinary (17);
A função chave que vai fazer nossos sonhos ^ ^
Código PHP:
DECLARE @ hash binário (16),
@ Myvarpass varchar (10),
@ Accid varchar (10);
DECLARE mytest CURSOR FOR SELECT memb___id SCROLL, memb__pwd DE MEMB_INFO
ABRIR mytest
FETCH NEXT mytest DE EM @ accid, @ myvarpass;
while (@ @ fetch_status = 0) BEGIN
EXEC master .. XP_MD5_EncodeKeyVal @ myvarpass, @ accid, @ OUT hash;
ATUALIZAÇÃO MEMB_INFO SET temphash = @ hash onde memb___id = @ accid;
FETCH NEXT mytest DE EM @ accid, @ myvarpass;
FIM
Mytest FECHAR
DEALLOCATE mytest
Agora vamos alterar o tipo da coluna memb__pwd.
Código PHP:
_pwd;
alterar a tabela memb_info add memb__pwd varbinary (17);
E agora para o golpe de misericórdia.
Código PHP:
atualização memb_info definir memb__pwd = temphash;
alterar a tabela temphash coluna memb_info gota;
Faça teste ;