Re: How to change password for sa?
From: Daan Stam (stam.JustSomeText@awvn.nl)
Date: 11/06/02
- Next message: Sean: "Help, hacker left files that I can't delete."
- Previous message: Jan Agermose: "Re: Connot generate SSPI context"
- In reply to: Dan Guzman: "Re: How to change password for sa?"
- Next in thread: Ivan D.: "Re: How to change password for sa?"
- Reply: Ivan D.: "Re: How to change password for sa?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Daan Stam" <stam.JustSomeText@awvn.nl> Date: Wed, 6 Nov 2002 15:27:28 +0100
This is a more friendly way to fix logins after a restore of database of
another server
Run it in the analyzer and the result grid gives you the commands for fixing
the found problems. (Just put the go command on a new line)
select 'sp_change_users_login @Action = ' + char(39) + 'auto_fix' +
char(39) + ', @usernamepattern = ' + char(39) + name + char(39) + char(13) +
'go'
from sysusers
where issqluser = 1 and (sid is not null and sid <> 0x0)
and suser_sname(sid) is null
order by name
Daan
stam.leavesomeout@awvn.nl
"Dan Guzman" <danguzman@nospam-earthlink.net> wrote in message
news:OQYv#YOhCHA.1392@tkmsftngp12...
> The error message is a bit misleading. The problem is that a database
> was restored/attached and the database owner recorded in sysdatabases is
> out-of-sync with sysusers. This confuses the EM GUI.
>
> You can run a script like the following to correct the mismatch.
>
> USE MyDatabase
> EXEC sp_addlogin 'TempOwner'
> EXEC sp_changedbowner 'TempOwner'
> EXEC sp_changedbowner 'sa'
> EXEC sp_droplogin 'TempOwner'
> GO
>
> See http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q218172& for
> details.
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
>
> -----------------------
> SQL FAQ links (courtesy Neil Pike):
>
> http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
> http://www.sqlserverfaq.com
> http://www.mssqlserver.com/faq
> -----------------------
>
> "Ivan D." <idych@yahoo.com> wrote in message
> news:#hX3XROhCHA.1736@tkmsftngp11...
> > Hello,
> >
> > I'm beginner with SQL administration, so probably this question is
> trivial
> > but... When I'm trying to change password for sa in "SQL Server Login
> > Properties - sa" window, I get the message:
> >
> > Error 21776: [SQL-DMO]The name 'dbo' was not found in the Users
> > collection... and the password's change fails.
> >
> > But this name does exist in every database_name\Users box. So what's
> wrong?
> >
> > Thanks. Ivan.
> >
> >
>
>
- Next message: Sean: "Help, hacker left files that I can't delete."
- Previous message: Jan Agermose: "Re: Connot generate SSPI context"
- In reply to: Dan Guzman: "Re: How to change password for sa?"
- Next in thread: Ivan D.: "Re: How to change password for sa?"
- Reply: Ivan D.: "Re: How to change password for sa?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|