Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sp_HealthParser/sp_HealthParser.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ BEGIN
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT
@version = '3.4',
@version_date = '20260217';
@version = '3.3',
@version_date = '20260301';

IF @help = 1
BEGIN
Expand Down
4 changes: 2 additions & 2 deletions sp_HumanEvents/sp_HumanEvents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ SET XACT_ABORT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT
@version = '7.2.5',
@version_date = '20260206';
@version = '7.3',
@version_date = '20260301';

IF @help = 1
BEGIN
Expand Down
4 changes: 2 additions & 2 deletions sp_HumanEvents/sp_HumanEventsBlockViewer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ SET XACT_ABORT OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT
@version = '5.2.5',
@version_date = '20260206';
@version = '5.3',
@version_date = '20260301';

IF @help = 1
BEGIN
Expand Down
4 changes: 2 additions & 2 deletions sp_IndexCleanup/sp_IndexCleanup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ BEGIN
SET NOCOUNT ON;
BEGIN TRY
SELECT
@version = '2.2.5',
@version_date = '20260206';
@version = '2.3',
@version_date = '20260301';

IF
/* Check SQL Server 2012+ for FORMAT and CONCAT functions */
Expand Down
4 changes: 2 additions & 2 deletions sp_LogHunter/sp_LogHunter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ SET DATEFORMAT MDY;

BEGIN
SELECT
@version = '3.2.5',
@version_date = '20260206';
@version = '3.3',
@version_date = '20260301';

IF @help = 1
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_PerfCheck/sp_PerfCheck.sql
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ BEGIN
*/
SELECT
@version = N'2.3',
@version_date = N'20260217';
@version_date = N'20260301';

/*
Help section, for help.
Expand Down
13 changes: 8 additions & 5 deletions sp_PressureDetector/sp_PressureDetector.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SET LANGUAGE us_english;

SELECT
@version = '6.2.5',
@version_date = '20260206';
@version = '6.3',
@version_date = '20260301';


IF @help = 1
Expand Down Expand Up @@ -2085,7 +2085,10 @@ OPTION(MAXDOP 1, RECOMPILE);',
N'Batch Requests/sec', N'SQL Compilations/sec', N'SQL Re-Compilations/sec', N'Longest Transaction Running Time', N'Log Bytes Flushed/sec',
N'Lock waits', N'Log buffer waits', N'Log write waits', N'Memory grant queue waits', N'Network IO waits', N'Log Flush Write Time (ms)',
N'Non-Page latch waits', N'Page IO latch waits', N'Page latch waits', N'Thread-safe memory objects waits', N'Wait for the worker',
N'Active parallel threads', N'Active requests', N'Blocked tasks', N'Query optimizations/sec', N'Queued requests', N'Reduced memory grants/sec'
N'Active parallel threads', N'Active requests', N'Blocked tasks', N'Query optimizations/sec', N'Queued requests', N'Reduced memory grants/sec',
N'Version Store Size (KB)', N'Free Space in tempdb (KB)', N'Active Temp Tables', N'Processes blocked', N'Full Scans/sec', N'Index Searches/sec',
N'Page Splits/sec', N'Free list stalls/sec', N'Workfiles Created/sec', N'Worktables Created/sec', N'Temp Tables Creation Rate', N'Version Generation rate (KB/s)',
N'Version Cleanup rate (KB/s)', N'Lock Timeouts/sec'
);


Expand Down Expand Up @@ -3228,7 +3231,7 @@ OPTION(MAXDOP 1, RECOMPILE);',
der.statement_start_offset,
der.statement_end_offset
) AS deqp
OUTER APPLY sys.dm_exec_sql_text(deqmg.plan_handle) AS dest' +
OUTER APPLY sys.dm_exec_sql_text(COALESCE(deqmg.sql_handle, deqmg.plan_handle)) AS dest' +
CASE
WHEN @live_plans = 1
THEN N'
Expand Down Expand Up @@ -3926,7 +3929,7 @@ OPTION(MAXDOP 1, RECOMPILE);',
ELSE DATEDIFF(MILLISECOND, der.start_time, SYSDATETIME())
END
) AS e
OUTER APPLY sys.dm_exec_sql_text(der.plan_handle) AS dest
OUTER APPLY sys.dm_exec_sql_text(COALESCE(der.sql_handle, der.plan_handle)) AS dest
OUTER APPLY sys.dm_exec_text_query_plan
(
der.plan_handle,
Expand Down
4 changes: 2 additions & 2 deletions sp_QueryReproBuilder/sp_QueryReproBuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ BEGIN TRY

/*Version*/
SELECT
@version = '1.2.5',
@version_date = '20260206';
@version = '1.3',
@version_date = '20260301';

/*Help*/
IF @help = 1
Expand Down
4 changes: 2 additions & 2 deletions sp_QueryStoreCleanup/sp_QueryStoreCleanup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ BEGIN
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT
@version = '1.0',
@version_date = '20260212';
@version = '1.3',
@version_date = '20260301';

/*
Help section
Expand Down
19 changes: 17 additions & 2 deletions sp_QuickieStore/sp_QuickieStore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ BEGIN TRY
These are for your outputs.
*/
SELECT
@version = '6.2.5',
@version_date = '20260206';
@version = '6.3',
@version_date = '20260301';

/*
Helpful section! For help.
Expand Down Expand Up @@ -1093,6 +1093,7 @@ CREATE TABLE
is_trivial_plan bit NOT NULL,
is_parallel_plan bit NOT NULL,
is_forced_plan bit NOT NULL,
toggle_forcing nvarchar(300) NOT NULL,
is_natively_compiled bit NOT NULL,
force_failure_count bigint NOT NULL,
last_force_failure_reason_desc nvarchar(128) NULL,
Expand Down Expand Up @@ -1553,11 +1554,13 @@ INSERT INTO
column_id, metric_group, metric_type, column_name, column_source, is_conditional, condition_param, condition_value, expert_only, format_pattern
)
VALUES
(10, 'emergency_troubleshooting', 'toggle_forcing', 'toggle_forcing', 'qsp.toggle_forcing', 0, NULL, NULL, 1, NULL),
(20, 'metadata', 'force_count', 'force_failure_count', 'qsp.force_failure_count', 0, NULL, NULL, 0, NULL),
(30, 'metadata', 'force_reason', 'last_force_failure_reason_desc', 'qsp.last_force_failure_reason_desc', 0, NULL, NULL, 0, NULL),
/* SQL 2022 specific columns */
(40, 'sql_2022', 'feedback', 'has_query_feedback', 'CASE WHEN EXISTS (SELECT 1/0 FROM #query_store_plan_feedback AS qspf WHERE qspf.plan_id = qsp.plan_id) THEN ''Yes'' ELSE ''No'' END', 1, 'sql_2022_views', 1, 0, NULL),
(50, 'sql_2022', 'hints', 'has_query_store_hints', 'CASE WHEN EXISTS (SELECT 1/0 FROM #query_store_query_hints AS qsqh WHERE qsqh.query_id = qsp.query_id) THEN ''Yes'' ELSE ''No'' END', 1, 'sql_2022_views', 1, 0, NULL),
(55, 'sql_2022', 'hints', 'set_query_store_hints', '''EXECUTE ''+ QUOTENAME(DB_NAME(qsp.database_id)) + ''.sys.sp_query_store_set_hints @query_id = '' + CONVERT(nvarchar(20), qsq.query_id) + '', @query_hints = N''''OPTION(older_hints_go_here, USE HINT(''''''''newer_hints_go_here''''''''))'''';''', 1, 'sql_2022_views', 1, 1, NULL),
(60, 'sql_2022', 'variants', 'has_plan_variants', 'CASE WHEN EXISTS (SELECT 1/0 FROM #query_store_query_variant AS qsqv WHERE qsqv.query_variant_query_id = qsp.query_id) THEN ''Yes'' ELSE ''No'' END', 1, 'sql_2022_views', 1, 0, NULL),
(70, 'sql_2022', 'replay', 'has_compile_replay_script', 'qsp.has_compile_replay_script', 1, 'sql_2022_views', 1, 0, NULL),
(80, 'sql_2022', 'opt_forcing', 'is_optimized_plan_forcing_disabled', 'qsp.is_optimized_plan_forcing_disabled', 1, 'sql_2022_views', 1, 0, NULL),
Expand Down Expand Up @@ -7018,6 +7021,14 @@ SELECT
qsp.is_trivial_plan,
qsp.is_parallel_plan,
qsp.is_forced_plan,
toggle_forcing =
CASE
qsp.is_forced_plan
WHEN 1
THEN ''EXECUTE ' + @database_name_quoted + '.sys.sp_query_store_unforce_plan @query_id = '' + CONVERT(nvarchar(20), qsp.query_id) + '', @plan_id = '' + CONVERT(nvarchar(20), qsp.plan_id) + '';''
WHEN 0
THEN ''EXECUTE ' + @database_name_quoted + '.sys.sp_query_store_force_plan @query_id = '' + CONVERT(nvarchar(20), qsp.query_id) + '', @plan_id = '' + CONVERT(nvarchar(20), qsp.plan_id) + '', @disable_optimized_plan_forcing = ? ;''
END,
qsp.is_natively_compiled,
qsp.force_failure_count,
qsp.last_force_failure_reason_desc,
Expand Down Expand Up @@ -7110,6 +7121,7 @@ WITH
is_trivial_plan,
is_parallel_plan,
is_forced_plan,
toggle_forcing,
is_natively_compiled,
force_failure_count,
last_force_failure_reason_desc,
Expand Down Expand Up @@ -8583,6 +8595,7 @@ FROM
WHEN @include_plan_hashes IS NOT NULL
OR @ignore_plan_hashes IS NOT NULL
OR @sort_order = 'plan count by hashes'
OR @expert_mode = 1
THEN N'
qsp.query_plan_hash,'
ELSE N''
Expand Down Expand Up @@ -9158,6 +9171,8 @@ BEGIN
qsqh.query_hint_id,
qsqh.query_id,
qsqh.query_hint_text,
remove_hint =
''EXECUTE '' + QUOTENAME(DB_NAME(qsqh.database_id)) + ''.sys.sp_query_store_clear_hints @query_id = '' + CONVERT(nvarchar(20), qsqh.query_id) + '';'',
qsqh.last_query_hint_failure_reason_desc,
query_hint_failure_count = ' +
CASE
Expand Down