Skip to content

Fix sp_kill README docs to match proc behavior#3886

Merged
BrentOzar merged 1 commit intodevfrom
3885_fix_sp_kill_docs
Apr 6, 2026
Merged

Fix sp_kill README docs to match proc behavior#3886
BrentOzar merged 1 commit intodevfrom
3885_fix_sp_kill_docs

Conversation

@BrentOzar
Copy link
Copy Markdown
Member

Summary

Addresses Copilot review feedback from #3885 (sp_kill docs only — sp_BlitzLock feedback will be handled separately):

  • @RequestsOlderThanMinutes@RequestsOlderThanSeconds: The example used a parameter name that doesn't exist in the proc. Fixed to @RequestsOlderThanSeconds = 300.
  • @SPIDState default: Docs said "empty string for both" but the proc validates NULL/S/R and raises an error on empty string. Fixed to "NULL for both (default)".
  • @ExecuteKills safety claim: Docs said a targeting filter is required with @ExecuteKills = 'Y', but the proc doesn't enforce that — it kills all non-system sessions when no filters are specified. Updated wording to accurately describe the behavior as a warning rather than a false constraint.

Test plan

  • Verify README parameter names match sp_kill.sql parameter declarations
  • Verify example code runs without error against the proc signature

🤖 Generated with Claude Code

Addresses Copilot review feedback from PR #3885:
- @RequestsOlderThanMinutes -> @RequestsOlderThanSeconds (param name)
- @SPIDState default is NULL, not empty string
- @ExecuteKills docs now accurately reflect that no filter = kill all

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 6, 2026 23:39
@BrentOzar BrentOzar added this to the 2026-04 Release milestone Apr 6, 2026
@BrentOzar BrentOzar merged commit 63470a8 into dev Apr 6, 2026
2 checks passed
@BrentOzar BrentOzar deleted the 3885_fix_sp_kill_docs branch April 6, 2026 23:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates sp_kill documentation in README.md to accurately reflect the stored procedure’s current parameter names, defaults/validation rules, and behavior when @ExecuteKills = 'Y'.

Changes:

  • Corrects the example parameter name to @RequestsOlderThanSeconds (with 300 seconds shown for 5 minutes).
  • Fixes @SPIDState default documentation to NULL (since empty string is invalid per proc validation).
  • Rewords @ExecuteKills = 'Y' guidance to warn that running without filters can kill broadly, rather than claiming a filter is enforced.

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

Parameters for targeting sessions:

* @ExecuteKills = 'Y' or 'N' (default 'N') - whether to actually kill, or just show recommendations. When set to 'Y', you must also specify at least one targeting filter to prevent accidentally killing everything.
* @ExecuteKills = 'Y' or 'N' (default 'N') - whether to actually kill, or just show recommendations. When set to 'Y' with no targeting filters, all non-system sessions are killed - so always specify at least one filter to avoid killing everything.
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The wording “all non-system sessions are killed” is a bit too absolute: sp_kill excludes the caller’s own session (s.session_id <> @OurSessionID) and never recommends/kills sessions in rollback status. Consider adjusting this sentence to match the proc’s actual eligibility rules (e.g., user sessions with session_id > 50, excluding your own and rollbacks) to avoid an apparent contradiction with the Safety features section below.

Suggested change
* @ExecuteKills = 'Y' or 'N' (default 'N') - whether to actually kill, or just show recommendations. When set to 'Y' with no targeting filters, all non-system sessions are killed - so always specify at least one filter to avoid killing everything.
* @ExecuteKills = 'Y' or 'N' (default 'N') - whether to actually kill, or just show recommendations. When set to 'Y' with no targeting filters, sp_kill can kill broadly across eligible user sessions (for example, user sessions with session_id > 50), excluding your own session and sessions already in rollback - so always specify at least one filter to avoid killing nearly everything.

Copilot uses AI. Check for mistakes.
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.

2 participants