Read-only Routing is a built-in facility where a connection string to a SQL Server Availability Group can read data from a Secondary Replica instead of the Primary Replica. A connection string flag is used to signal a read-only intent.
Month: June 2022
Manage Database Owners
From the archives … To list database owners
SELECT name, SUSER_SNAME(owner_sid) owner
FROM sys.databases;
To change a database owner
USE SomeDatabaseName;
GO
EXEC sp_changedbowner notsa;
GO
To change ALL database owners
EXEC sp_msforeachdb
'USE [?]; IF db_id() > 4 EXEC sp_changedbowner notsa';