-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsp_MonitorQueryStore.sql
More file actions
28 lines (26 loc) · 1022 Bytes
/
sp_MonitorQueryStore.sql
File metadata and controls
28 lines (26 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CREATE OR ALTER PROCEDURE [dbo].[sp_MonitorQueryStore]
(
@CheckConfiguration BIT = 0,
@Databases NVARCHAR(MAX) = 'ALL',
@ConfigTable NVARCHAR(4000) = 'dbo.MonitorQueryStoreConfig'
@LoggingTable NVARCHAR(4000) = 'dbo.MonitorQueryStoreLogging',
@DefaultAlerting BIT = 1,
@EnableReadWriteState BIT = 1,
@UnforceFailedPlans BIT = 1,
@UnforceFailedPlansThreshold INT = 5,
@MonitorPlanRegression BIT = 0,
@Debug BIT = 0
)
AS
BEGIN
/*
sp_MonitorQueryStore By DataPaws
Documentation: https://datapawsconsulting.com/sp_MonitorQueryStore
Version: 02/16/2026 13:43
GitHub: https://github.com/DataPaws/sp_MonitorQueryStore
Requirements:
sp_ineachdb - From Brent Ozar's First Responder Kit - https://raw.githubusercontent.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/main/sp_ineachdb.sql
Description:
This procedure monitors various aspects of the SQL Server 2016+ feature Query Store and can generate alerts,
attempt to automatically resolve issues, and provide recommendations on Query Store related settings.
*/