3

I ran an ALTER AUTHORIZATION to change a database owner from an AD account to sa and it seemed to cause the user mapping for a specific database to be removed. I’m not sure why this happened.

Is this normal and expected behaviour?

3

The database owner is mapped to the dbo user in the database, so when you change the database owner, you change which login is mapped to the dbo user.

The previous database owner may loose access to the database.

eg

use master
drop database mydatabase
go
create database mydatabase
go
use mydatabase
go
select sid
from sys.database_principals 
where principal_id = 1
go
alter authorization on database::mydatabase to sa
go
select sid
from sys.database_principals 
where principal_id = 1

outputs

sid
-------------------
0x0105000000000005. . . 

(1 row affected)

sid
-------------------
0x01

(1 row affected)
|improve this answer|||||
  • Thank you very much. That explains it! – stephen May 16 '19 at 19:26
  • @stephen Great that it solved your question, could you accept the answer so that it is clear for future readers? Here is some more information on accepting answers. – Randi Vertongen May 17 '19 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.