Skip to content

sp_BlitzLock: replace deprecated sp_BlitzQueryStore call with sp_QuickieStore - #4017

Merged
BrentOzar merged 2 commits into
devfrom
blitzlock-replace-blitzquerystore
Jun 4, 2026
Merged

sp_BlitzLock: replace deprecated sp_BlitzQueryStore call with sp_QuickieStore#4017
BrentOzar merged 2 commits into
devfrom
blitzlock-replace-blitzquerystore

Conversation

@BrentOzar

Copy link
Copy Markdown
Member

Fixes #4010.

Summary

Check 8 in sp_BlitzLock emits a "More Info - Query" finding for every stored procedure that appears in a deadlock stack. That finding used to be an EXECUTE sp_BlitzQueryStore call — a proc that's been deprecated. Replaced with Erik Darling's sp_QuickieStore, which serves the same purpose (Query Store explorer keyed by database + procedure name) per the discussion on the issue.

Mapping

sp_BlitzQueryStore sp_QuickieStore
@DatabaseName @database_name
@StoredProcName @procedure_name

Confirmed param names from the canonical source at https://github.com/erikdarlingdata/DarlingData/blob/main/sp_QuickieStore/sp_QuickieStore.sql.

Other touch-ups in the same block

  • Section comment at the top of Check 8 now reads sp_QuickieStore instead of BlitzQueryStore.
  • Debug RAISERROR message ("Check 8 more info part 2 …") matches.
  • Inline comment above the finding = block explains that sp_QuickieStore is an external Erik Darling tool the user installs separately, and notes that sp_BlitzQueryStore (its predecessor) is deprecated — so a future maintainer doesn't wonder where the old call went.

What stays the same

  • The IF (@ProductVersionMajor >= 13 OR @Azure = 1) guard. sp_QuickieStore also requires Query Store (SQL 2016+), so the same gate applies.

Test plan

  • On a 2016+ instance with at least one stored-proc deadlock in the event-file source, run sp_BlitzLock and confirm Check 8 emits EXECUTE sp_QuickieStore @database_name = '…', @procedure_name = '…'; for each proc in the stack.
  • Confirm Check 8 still skips silently on pre-2016 / non-Azure instances (the version guard is unchanged).

🤖 Generated with Claude Code

…kieStore

Fixes #4010. Check 8's "More Info - Query" finding for stored-procedure
deadlocks used to emit an EXECUTE sp_BlitzQueryStore call - that proc is
deprecated and no longer maintained. Per the issue discussion the right
replacement is Erik Darling's sp_QuickieStore
(https://erikdarling.com/sp_quickiestore/), which has the same shape:
a Query Store explorer keyed by database + procedure name.

Mapping:
  sp_BlitzQueryStore @DatabaseName    -> sp_QuickieStore @database_name
  sp_BlitzQueryStore @StoredProcName  -> sp_QuickieStore @procedure_name

The Query Store availability guard (@ProductVersionMajor >= 13 OR @Azure = 1)
stays - sp_QuickieStore also requires Query Store, which is SQL 2016+.

Also updated:
  - the section comment at line 2809
  - the debug RAISERROR message at line 2894
so future readers don't see stale "BlitzQueryStore" references.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 12:16
@BrentOzar BrentOzar added this to the 2026-07 Release milestone Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates sp_BlitzLock Check 8 “More Info - Query” output to stop emitting calls to the deprecated sp_BlitzQueryStore and instead emit equivalent sp_QuickieStore calls (per #4010), keeping the existing Query Store version/Azure guard in place.

Changes:

  • Replaced the generated “More Info - Query” command from EXECUTE sp_BlitzQueryStore ... to EXECUTE sp_QuickieStore ... with mapped parameter names.
  • Updated the Check 8 section comment and debug RAISERROR text to reference sp_QuickieStore.
  • Added an inline comment noting sp_QuickieStore is an external dependency and that sp_BlitzQueryStore is deprecated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sp_BlitzLock.sql Outdated
N'@DatabaseName = ' +
N'EXECUTE sp_QuickieStore ' +
N'@database_name = ' +
QUOTENAME(ds.database_name, N'''') +

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - fixed in the latest commit on this branch. Switched the source from ds.database_name (PARSENAME of proc_name, which is NULL whenever the stack frame isn't 3-part) to dow.database_name (derived from database_id at deadlock-capture time). Same source the SELECT already uses 4 lines up for the output's database_name column, so no new dependencies.

Copilot review on PR #4017 flagged that ds.database_name comes from
PARSENAME(ds.proc_name, 3), which returns NULL whenever the proc_name
isn't a 3-part identifier. QUOTENAME(NULL, '''') propagates NULL
through the rest of the string concat, so the entire finding becomes
NULL and the user gets nothing to copy/paste.

Switched to dow.database_name (derived from dow.database_id at
deadlock-capture time, already used 4 lines up for the output's
database_name column). Same data, more reliable source, stays
consistent with the rest of the SELECT.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@BrentOzar
BrentOzar merged commit 05a71a1 into dev Jun 4, 2026
1 check passed
@BrentOzar
BrentOzar deleted the blitzlock-replace-blitzquerystore branch June 4, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sp_BlitzLock: remove more info query for outdated component that has been deprecated (sp_BlitzQueryStore)

2 participants