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?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
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
The previous database owner may loose access to the database.
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
sid ------------------- 0x0105000000000005. . . (1 row affected) sid ------------------- 0x01 (1 row affected)