sp_password

From: Leon Parker (anonymous_at_devdex.com)
Date: 06/19/03


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!



Relevant Pages

  • Re: PLS-00306: wrong number or types of arguments in call
    ... > I am trying to execute this Stored Procedure, and it gives me an error ... the error message seems pretty clear - you're either passing in ...
    (microsoft.public.dotnet.general)
  • Re: limit sql agent job resource with resource governor
    ... during the job run and still see the same login. ... If you have a sample classifier function code that uses ... do its work (including "execute as")... ... before Agent executes the EXECUTE AS command. ...
    (microsoft.public.sqlserver.server)
  • Re: limit sql agent job resource with resource governor
    ... I run the DMV query multiple times ... during the job run and still see the same login. ... do its work (including "execute as")... ... before Agent executes the EXECUTE AS command. ...
    (microsoft.public.sqlserver.server)
  • Re: pam_acct_mgmt(): user account has expired (was Re: Login
    ... I enter my normal login and then my password. ... > The last error message will repeat with the number getting ... All accounts, including root, are "expired". ... 'pam_acct_mgmt: user accound has expired' ...
    (freebsd-questions)
  • RE: Loged ot direct at login
    ... Keyboard, Monitor, are you able to login?. ... Also look in the event Viewer for error messages that can shed some light on ... Look in the right Pane/window for error message with red or Yellow ... Click on the two pages to copy the error message then bring up the Notepad ...
    (microsoft.public.windowsxp.accessibility)