From f2987015e9163be32bc722d57ec31f1986648335 Mon Sep 17 00:00:00 2001 From: OEdling <32391217+OEdling@users.noreply.github.com> Date: Tue, 3 Feb 2026 09:26:31 +0100 Subject: [PATCH] Update sp_CheckAG.sql Changed the check for SA to work with renamed SA login. --- sp_CheckAG.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sp_CheckAG.sql b/sp_CheckAG.sql index eca0352..56baac8 100644 --- a/sp_CheckAG.sql +++ b/sp_CheckAG.sql @@ -1029,7 +1029,7 @@ IF @Mode IN (0, 99) BEGIN , 'We recommend setting endpoint ownership to ''sa'' to avoid connection issues.' , 'https://straightpathsql.com/ca/endpoint-ownership' FROM #Endpoints - WHERE EndpointOwner <> 'sa'; + WHERE EndpointOwner <> SUSER_SNAME(0x01); /* AG not owned by sa */ INSERT #Results @@ -1044,7 +1044,7 @@ IF @Mode IN (0, 99) BEGIN , 'We recommend setting availability group ownership to ''sa'' to avoid connection issues.' , 'https://straightpathsql.com/ca/availability-group-ownership' FROM #AvailabilityGroups - WHERE AGOwner <> 'sa'; + WHERE AGOwner <> SUSER_SNAME(0x01); /* Less than 3 quorum members online */ IF (SELECT COUNT(MemberName) FROM #ClusterMembers WHERE MemberState = 'UP' AND NumberOfQuorumVotes > 0) < 3