Re: Using PwdEncrypt

From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 01/10/04

  • Next message: Richard Waymire [MSFT]: "Re: Profiler Security"
    Date: Fri, 9 Jan 2004 20:06:58 -0600
    
    

    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" <anonymous@discussions.microsoft.com> wrote in message
    news:034a01c3d718$aaa7daa0$a601280a@phx.gbl...
    > 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
    >
    

  • Next message: Richard Waymire [MSFT]: "Re: Profiler Security"