Skip to content

Commit d7d97b0

Browse files
authored
Update sp_BlitzFirst to allow @ShowSleepingSPIDs
Minor change to allow for the @ShowSleepingSPIDs paramater to be passed to sp_BlitzWho. Have changed the EXEC into dynamic SQL to allow for this. Same issue as with sp_BlitzWho with regards to data types. I've kept as a TINYINT but we're having to convert for the dynamic SQL to NVARCHAR.
1 parent 1f9e704 commit d7d97b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sp_BlitzFirst.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ALTER PROCEDURE [dbo].[sp_BlitzFirst]
2222
@CheckProcedureCache TINYINT = 0 ,
2323
@FileLatencyThresholdMS INT = 100 ,
2424
@SinceStartup TINYINT = 0 ,
25+
@ShowSleepingSPIDs TINYINT = 1 ,
2526
@VersionDate DATETIME = NULL OUTPUT
2627
WITH EXECUTE AS CALLER, RECOMPILE
2728
AS
@@ -172,7 +173,8 @@ BEGIN
172173
END
173174
ELSE
174175
BEGIN
175-
EXEC [dbo].[sp_BlitzWho]
176+
DECLARE @BlitzWho NVARCHAR(MAX) = 'EXEC [dbo].[sp_BlitzWho] @ShowSleepingSPIDs = ' + CONVERT(NVARCHAR(1), @ShowSleepingSPIDs)
177+
EXEC (@BlitzWho)
176178
END
177179
END /* IF @SinceStartup = 0 AND @Seconds > 0 AND @ExpertMode = 1 - What's running right now? This is the first and last result set. */
178180

@@ -2501,4 +2503,4 @@ EXEC sp_BlitzFirst @Seconds = 60
25012503
, @OutputTableNameFileStats = 'BlitzFirstResults_FileStats'
25022504
, @OutputTableNamePerfmonStats = 'BlitzFirstResults_PerfmonStats'
25032505
, @OutputTableNameWaitStats = 'BlitzFirstResults_WaitStats'
2504-
*/
2506+
*/

0 commit comments

Comments
 (0)