Skip to content

Commit 63470a8

Browse files
authored
Merge pull request #3886 from BrentOzarULTD/3885_fix_sp_kill_docs
Fix sp_kill README docs to match proc behavior
2 parents bdd73ca + 1079dd8 commit 63470a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,25 +350,25 @@ EXEC sp_kill @SPID = 55, @ExecuteKills = 'Y';
350350
351351
/* Kill sleeping sessions with open transactions idle for 5+ minutes: */
352352
EXEC sp_kill @HasOpenTran = 'Y', @SPIDState = 'S',
353-
@RequestsOlderThanMinutes = 5, @ExecuteKills = 'Y';
353+
@RequestsOlderThanSeconds = 300, @ExecuteKills = 'Y';
354354
355355
/* Show what we'd kill for a login, sorted by CPU: */
356356
EXEC sp_kill @LoginName = 'DOMAIN\TroublesomeUser', @OrderBy = 'cpu';
357357
```
358358

359359
Parameters for targeting sessions:
360360

361-
* @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.
361+
* @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.
362362
* @SPID - target a specific session ID.
363363
* @LoginName - kill sessions belonging to this login.
364364
* @AppName - kill sessions from this application (supports LIKE wildcards).
365365
* @DatabaseName - kill sessions using this database.
366366
* @HostName - kill sessions from this host.
367367
* @LeadBlockers = 'Y' - kill only lead blockers (sessions blocking others but not blocked themselves).
368368
* @ReadOnly = 'Y' - only kill read-only queries (SELECTs with no writes).
369-
* @SPIDState - 'S' for sleeping sessions only, 'R' for running only, empty string for both (default).
369+
* @SPIDState - 'S' for sleeping sessions only, 'R' for running only, NULL for both (default).
370370
* @HasOpenTran = 'Y' - only target sessions with open transactions. Combine with @SPIDState = 'S' to catch sleeping sessions with forgotten transactions.
371-
* @RequestsOlderThanMinutes - only target sessions whose last request started at least this many minutes ago.
371+
* @RequestsOlderThanSeconds - only target sessions whose last request started at least this many seconds ago.
372372
* @OmitLogin - exclude sessions belonging to this login from kill recommendations.
373373
* @OrderBy - sort order for kill recommendations: duration (default), cpu, reads, writes, tempdb, transactions. Useful when you want to kill the worst offenders one by one.
374374

0 commit comments

Comments
 (0)