W tym cały problem.
Wyświetlam ownera jest nim użytkownik, którym próbuje zmienić ownera na sa
USE [master]
GO
SELECT suser_sname(owner_sid)
FROM sys.databases
WHERE name = 'DB'
GO
W dokumentacji mam:
db_owner Members of the db_owner fixed database role can perform all configuration and maintenance activities on the database, and can also drop the database in SQL Server. (In SQL Database and SQL Data Warehouse, some maintenance activities require server-level permissions and cannot be performed by db_owners.)
dlatego pytam dlaczego po wykonaniu poniższego skryptu, otrzymuję błąd skoro jestem db_owner bazy DB ?
USE [DB]
GO
ALTER AUTHORIZATION ON DATABASE::[DB] TO [sa]
GO
Msg 15151, Level 16, State 1, Line 3
Cannot find the principal 'sa', because it does not exist or you do not have permission.
Jestem laikiem proszę o wyrozumiałość. Może czegoś nie rozumiem :(