Fix sp_kill README docs to match proc behavior#3886
Conversation
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>
There was a problem hiding this comment.
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(with300seconds shown for 5 minutes). - Fixes
@SPIDStatedefault documentation toNULL(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. |
There was a problem hiding this comment.
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.
| * @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. |
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.@SPIDStatedefault: Docs said "empty string for both" but the proc validatesNULL/S/Rand raises an error on empty string. Fixed to "NULL for both (default)".@ExecuteKillssafety 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
sp_kill.sqlparameter declarations🤖 Generated with Claude Code