azure sql database – Unable to transfer role ownership to dbo

In Azure SQL Database we have bunch of Database Roles that are not being owned by DBO. I’ve used following query to get them

SELECT  *
FROM   sys.database_principals
WHERE type="R" and owning_principal_id <> 1

I’m attempting to transfer ownership of these to DBO using following query:

ALTER AUTHORIZATION ON ROLE::[RoleName] TO [dbo]

However I’m getting

Msg 104001, Level 16, State 1, Line 18
Incorrect syntax near 'ON ROLE::[RoleName]'.

I am added to DB_Owner & as an Entra ID Administrator in Azure Portal itself, so privileges shouldn’t be an issue here

Read more here: Source link