I have restored a database which has tables belonging to a
particular user account created. However, after
restoration, I am not able to see the user account in the
User/Logins item and not able to create a new account with
the same name and making it the db_owner at the same time.
The system gives me this error.
Using sp_helpusers for this database, I realised that
there is a user account with the name "abc" but there is
no value in the "loginName" & "DefDBName" fields.
Please advise how I can sync this.
Thanks.It sounds as though the user is orphaned
Exec sp_change_users_login 'Report'
will show you this info
You can use the 'Update_One' parameter to match things up
OR you could simply use
Exec sp_revokedbaccess 'Name in DB'
EXEC sp_grantdbaccess [@.loginame =] 'login'
[,[@.name_in_db =] 'name_in_db' [OUTPUT]]
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Dara" <dara.lim@.ogilvy.com> wrote in message
news:075e01c35bf0$2360f020$a501280a@.phx.gbl...
> I have restored a database which has tables belonging to a
> particular user account created. However, after
> restoration, I am not able to see the user account in the
> User/Logins item and not able to create a new account with
> the same name and making it the db_owner at the same time.
> The system gives me this error.
> Using sp_helpusers for this database, I realised that
> there is a user account with the name "abc" but there is
> no value in the "loginName" & "DefDBName" fields.
> Please advise how I can sync this.
> Thanks.|||Hi Dara,
If you have a login for that user on your server you can use the
sp_change_users_login stored procedure to fix your problems. See Books
Online for the details.
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Dara" <dara.lim@.ogilvy.com> wrote in message
news:075e01c35bf0$2360f020$a501280a@.phx.gbl...
> I have restored a database which has tables belonging to a
> particular user account created. However, after
> restoration, I am not able to see the user account in the
> User/Logins item and not able to create a new account with
> the same name and making it the db_owner at the same time.
> The system gives me this error.
> Using sp_helpusers for this database, I realised that
> there is a user account with the name "abc" but there is
> no value in the "loginName" & "DefDBName" fields.
> Please advise how I can sync this.
> Thanks.
Showing posts with label restored. Show all posts
Showing posts with label restored. Show all posts
Thursday, March 22, 2012
Error 15007 - login 'user1' does not exist
I restored a test database from a backup of production
and my users using a user account called user could not
login again. I try to create a new user and get the above
message. Any help please.This is a multi-part message in MIME format.
--=_NextPart_000_026A_01C34FA0.C1C01AE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Check out sp_change_users_login in the BOL.
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aboki" <waco361@.hotmail.com> wrote in message =news:099201c34fc1$7b3948a0$a001280a@.phx.gbl...
I restored a test database from a backup of production and my users using a user account called user could not login again. I try to create a new user and get the above message. Any help please.
--=_NextPart_000_026A_01C34FA0.C1C01AE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Check out sp_change_users_login in the =BOL.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Aboki" wrote in =message news:099201c34fc1$7b=3948a0$a001280a@.phx.gbl...I restored a test database from a backup of production and my users =using a user account called user could not login again. I try to create a =new user and get the above message. Any help please.
--=_NextPart_000_026A_01C34FA0.C1C01AE0--
and my users using a user account called user could not
login again. I try to create a new user and get the above
message. Any help please.This is a multi-part message in MIME format.
--=_NextPart_000_026A_01C34FA0.C1C01AE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Check out sp_change_users_login in the BOL.
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Aboki" <waco361@.hotmail.com> wrote in message =news:099201c34fc1$7b3948a0$a001280a@.phx.gbl...
I restored a test database from a backup of production and my users using a user account called user could not login again. I try to create a new user and get the above message. Any help please.
--=_NextPart_000_026A_01C34FA0.C1C01AE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Check out sp_change_users_login in the =BOL.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Aboki"
--=_NextPart_000_026A_01C34FA0.C1C01AE0--
Subscribe to:
Comments (Atom)