Link to home
Start Free TrialLog in
Avatar of faclogistics
faclogistics

asked on

DBO User ISSUE

I've attached a database from one server to another and the dbo user is still located at the database level but i'm unable to give the sa user access to the database because it was already located at the db level.

I am also doing transactional replication and I'm getting this error:

Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission. (Source: MSSQLServer, Error number: 15517)

Anybody know a fix to this issue?
Avatar of mcv22
mcv22
Flag of United States of America image

The sa user might have been orphaned. Run the following command in the database.

Another option is to drop the sa user from the restored database and map it again (this will lose any explicit permissions assigned in that database).
exec sp_change_users_login 'auto_fix', 'sa'

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aaron Shilo
Aaron Shilo
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial