Wednesday, February 15, 2012

Error 21002 [SQL-DMO) User 'account' already exists

I restored a database and tried setting permissions on my accounts and recieved the following error:
Error 21002 [SQL-DMO] User acct already exists.
Whats this?
Can anyone help?
Thanks
MMSeems you want to read about sp_change_users_logins in Books Online. For a GUI on top of the
command, see:
http://www.dbmaint.com/SyncSqlLogins.asp
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"MM" <anonymous@.discussions.microsoft.com> wrote in message
news:832FD572-1F3A-4A2D-B027-A7B04BFE19EB@.microsoft.com...
> I restored a database and tried setting permissions on my accounts and recieved the following
error:
> Error 21002 [SQL-DMO] User acct already exists.
> Whats this?
> Can anyone help?
> Thanks
> MM|||Your sids do not match more than likely. When you create a
login(sysxlogins) a sid is made and when you add that login to a database as
a user the sid is copied(sysusers). The sid is unique and different on each
server, even for the same login name. You will not see the users in the
GUI(remember GUI is evil and dumb), however if you query the sysusers of
that database you will see those names. Drop all users using T-SQL and add
them back. Good luck.
"MM" <anonymous@.discussions.microsoft.com> wrote in message
news:832FD572-1F3A-4A2D-B027-A7B04BFE19EB@.microsoft.com...
> I restored a database and tried setting permissions on my accounts and
recieved the following error:
> Error 21002 [SQL-DMO] User acct already exists.
> Whats this?
> Can anyone help?
> Thanks
> MM|||"Kevin Brooks" <jeepnreb@.yahoo.com> wrote in message
news:eNzqsFMxDHA.2328@.TK2MSFTNGP10.phx.gbl...
> Your sids do not match more than likely. When you create a
> login(sysxlogins) a sid is made and when you add that login to a database
as
> a user the sid is copied(sysusers). The sid is unique and different on
each
> server, even for the same login name. You will not see the users in the
> GUI(remember GUI is evil and dumb), however if you query the sysusers of
> that database you will see those names. Drop all users using T-SQL and
add
> them back. Good luck.
> "MM" <anonymous@.discussions.microsoft.com> wrote in message
> news:832FD572-1F3A-4A2D-B027-A7B04BFE19EB@.microsoft.com...
> > I restored a database and tried setting permissions on my accounts and
> recieved the following error:
> >
> > Error 21002 [SQL-DMO] User acct already exists.
> >
> > Whats this?
> >
> > Can anyone help?
> >
> > Thanks
> >
> > MM
>

No comments:

Post a Comment