Re: Using PwdEncrypt
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: Sun, 11 Jan 2004 11:40:37 -0600
I honestly don't know if/when pwdencrypt will removed/revised/replaced.
As Dejan suggested, you should probably consider a 3rd party tool or develop
your own for this functionality. This sort of thing will be much easier in
Yukon since you can write functions using .Net code, allowing you to
leverage managed APIs from within SQL Server.
-- Hope this helps. Dan Guzman SQL Server MVP "Giacomo" <firstname.lastname@example.org> wrote in message news:OXonITG2DHA.email@example.com... > Dan, > If it is removed..., will it not be replaced? It is a wonderful tool. Is > there anything quite as good out there? > Giac > > "Dan Guzman" <firstname.lastname@example.org> wrote in message > news:O4RDv5x1DHA.3656@TK2MSFTNGP11.phx.gbl... > > Aside from the missing 'AS' in the CREATE PROCEDURE, I see no problems > with > > the code you posted. The cause of the error is probably in the statement > > executing the procedure. > > > > In any case, I strongly suggest that you don't include undocumented > > functionality like pwencrypt in production code. The behavior may change > > (or be removed) in future SQL Server versions or service packs and break > > your application. > > > > -- > > Hope this helps. > > > > Dan Guzman > > SQL Server MVP > > > > > > "Giacomo" <email@example.com> wrote in message > > news:firstname.lastname@example.org... > > > Hello, > > > I'm using pwdencrypt to create user passwords. When I try > > > to update one that was previously created I get an error: > > > > > > Incorrect syntax near 'mypassword'. > > > > > > Does the nature of a varbinary(255) cause it to not work > > > in a statement like: > > > ----------------------- > > > Create Procedure PWDUpdate(@Pin varchar(64),@ID INT) > > > UPDATE RegisteredUsers SET [Password]=dbo.FnPWDGET (@Pin) > > > WHERE [ID]=@ID > > > ----------------------- > > > dbo.FnPWDGET looks like: > > > > > > CREATE FUNCTION FnPWDGET (@Name varchar(64)) > > > RETURNS Varbinary(255) AS > > > BEGIN > > > DECLARE @Output varbinary(255) > > > SELECT @Output=(CONVERT(varbinary(255), pwdencrypt(@Name))) > > > RETURN @Output > > > END > > > > > > Help, > > > Giac > > > > > > > > >