Thanks for following up. I was not aware of this undocumented function pwdcompare - interesting (and a little surprising to me).One thing, this will not work for windows authentication logins (thankfully). Also, you could simplify your statement somewhat. I took the liberty of changing the functionality slightly:use mastergoCREATE PROCEDURE [dbo].[sp_VerifyPassword]@password as varchar(50),@sqlloginname as varchar(50) = nullASselect pwdcompare(@password, password) [PW_Match] ,[name] ,db_name(dbid) [defaultDB]from sysxlogins where [name] = isNull(@sqlloginname, [name])order by 1 desc-----------------------------------------------------------test itgosp_addlogin 'junk', '#bF89 AA00a', 'tempdb'goexec sp_VerifyPassword @password = '#bF89 AA00a' ,@sqlloginName = 'junk'exec sp_droplogin 'junk'drop proc sp_VerifyPasswordoutput:New login created.PW_Match name defaultDB ----------- -----------------------------1 junk tempdb(1 row(s) affected)Login dropped.
Be One with the OptimizerTG