Changing A Database Owner

A database owner is typically set to ‘sa’ to mitigate having orphaned owners when the person who created the database leaves the business.

The legacy way of changing a database owner was:

USE [databasehavingnamechanged]
GO
EXEC sp_changedbowner 'sa';
GO

The recommended SQL Server 2008 and newer way is:

USE [master]
GO
ALTER AUTHORIZATION ON DATABASE::[databasehavingnamechanged] TO [sa];
GO

Leave a Reply