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.
No comments:
Post a Comment