Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DBO User ISSUE

Posted on 2011-02-17
2
1,195 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:faclogistics
2 Comments
 
LVL 12

Expert Comment

by:mcv22
ID: 34922630
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

0
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 500 total points
ID: 34923774
To work around this problem, change the database owner to a valid login or domain user. To do this, run the following statements:
USE <DatabaseName>
GO
sp_changedbowner '<NewLogin>'

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question