patternMinor
Steal ownership on database from user that no longer exists
Viewed 0 times
userlongerstealdatabasethatexistsfromownership
Problem
We have a few SQL Server 2008 R2 databases where its member domain was changed (i.e. it was connected to
I have tried logging on to SQL Server as
Error:
Msg 15151, Level 16, State 1, Line 1
Cannot find the object 'DestDB', because it does not exist or you do not have permission.
I was under the (obviously incorrect) assumption that
How can I get ownership of these databases back?
DOMAINA and is now on DOMAINB). We have three databases where the owner of the database is DOMAINA\User, which no longer exists.I have tried logging on to SQL Server as
DOMAINB\Administrator and sa and run the following command:ALTER AUTHORIZATION ON DestDB TO saError:
Msg 15151, Level 16, State 1, Line 1
Cannot find the object 'DestDB', because it does not exist or you do not have permission.
I was under the (obviously incorrect) assumption that
sa could do virtually anything on the server.How can I get ownership of these databases back?
Solution
The syntax you're using is attempting to change ownership of the object 'DestDB' within whatever database context you're currently in. You need to specify that you're changing database ownership by using the class definition:
ALTER AUTHORIZATION ON DATABASE::[DestDB] TO [sa]Context
StackExchange Database Administrators Q#33871, answer score: 9
Revisions (0)
No revisions yet.