Skip to content

Commit

Permalink
Update sp_QuickieStore.sql
Browse files Browse the repository at this point in the history
Add another check to prevent AG query
  • Loading branch information
erikdarlingdata committed Apr 2, 2024
1 parent d783041 commit 67ed9ee
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions sp_QuickieStore/sp_QuickieStore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2308,19 +2308,30 @@ BEGIN
END;
ELSE
BEGIN
SELECT
@ags_present =
CASE
WHEN EXISTS
(
SELECT
1/0
FROM sys.availability_groups AS ag
)
THEN 1
ELSE 0
END
IF
(
SELECT
CONVERT
(
sysname,
SERVERPROPERTY('EngineEdition')
)
) NOT IN (5, 8)
BEGIN
SELECT
@ags_present =
CASE
WHEN EXISTS
(
SELECT
1/0
FROM sys.availability_groups AS ag
)
THEN 1
ELSE 0
END
OPTION(RECOMPILE);
END
END;

/*
Expand Down

0 comments on commit 67ed9ee

Please sign in to comment.