sp_password
From: Leon Parker (anonymous_at_devdex.com)
Date: 06/19/03
- Next message: Paul Amarante: "Re: db_backupoperator role on SQL Server 2000"
- Previous message: Vijay: "Re : Active Directory and SQL Server NT Authentication problem"
- Next in thread: Dan Guzman: "Re: sp_password"
- Reply: Dan Guzman: "Re: sp_password"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 19 Jun 2003 10:16:20 -0700
Here is a copy of my script where I'm passing in parameter names.
Whenever I execute the procedure I get the error message that the login
'@login' does not exist. Apparently my parameter is not being passed in
correctly. Can anyone help with the syntax here?
IF @cnt >= 2
Begin
select @loginname = (select top 1 i.loginname from inserted i)
set @msgtxt = 'SQL username account has been locked out: ' +@loginname
exec master.dbo.xp_sendmail @recipients ='lparker.com',
@message = @msgtxt,
@subject = 'Login Access Violation'
select @NewPassword = 'Lockout' + datename(ms,getdate())
EXEC master.dbo.xp_cmdshell 'osql -U ldp -P newldp -b -q "exec
sp_password NULL, @new = ''@NewPassword'', @loginame = ''@loginname'' "
'
End
Leon Parker
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Paul Amarante: "Re: db_backupoperator role on SQL Server 2000"
- Previous message: Vijay: "Re : Active Directory and SQL Server NT Authentication problem"
- Next in thread: Dan Guzman: "Re: sp_password"
- Reply: Dan Guzman: "Re: sp_password"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|