You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sp_BlitzFirst.sql
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -275,7 +275,7 @@ BEGIN
275
275
END; /* IF @SinceStartup = 0 AND @Seconds > 0 AND @ExpertMode = 1 AND @OutputType <> 'NONE' - What's running right now? This is the first and last result set. */
276
276
277
277
/* Set start/finish times AFTER sp_BlitzWho runs. For more info: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2244 */
278
-
IF @Seconds =0ANDSERVERPROPERTY('Edition') ='SQL Azure'
278
+
IF @Seconds =0ANDSERVERPROPERTY('EngineEdition') =5/*SERVERPROPERTY('Edition') = 'SQL Azure'*/
SET @StringToExecute = @StringToExecute +N' FROM sys.dm_db_wait_stats os ';
1405
1405
ELSE
1406
1406
SET @StringToExecute = @StringToExecute +N' FROM sys.dm_os_wait_stats os ';
@@ -1551,7 +1551,7 @@ BEGIN
1551
1551
END
1552
1552
1553
1553
/* If there's a backup running, add details explaining how long full backup has been taking in the last month. */
1554
-
IF @Seconds >0ANDCAST(SERVERPROPERTY('edition') ASVARCHAR(100)) <>'SQL Azure'
1554
+
IF @Seconds >0ANDSERVERPROPERTY('EngineEdition') <>5/*CAST(SERVERPROPERTY('edition') AS VARCHAR(100)) <> 'SQL Azure'*/
1555
1555
BEGIN
1556
1556
SET @StringToExecute ='UPDATE #BlitzFirstResults SET Details = Details + '' Over the last 60 days, the full backup usually takes '' + CAST((SELECT AVG(DATEDIFF(mi, bs.backup_start_date, bs.backup_finish_date)) FROM msdb.dbo.backupset bs WHERE abr.DatabaseName = bs.database_name AND bs.type = ''D'' AND bs.backup_start_date > DATEADD(dd, -60, SYSDATETIMEOFFSET()) AND bs.backup_finish_date IS NOT NULL) AS NVARCHAR(100)) + '' minutes.'' FROM #BlitzFirstResults abr WHERE abr.CheckID = 1 AND EXISTS (SELECT * FROM msdb.dbo.backupset bs WHERE bs.type = ''D'' AND bs.backup_start_date > DATEADD(dd, -60, SYSDATETIMEOFFSET()) AND bs.backup_finish_date IS NOT NULL AND abr.DatabaseName = bs.database_name AND DATEDIFF(mi, bs.backup_start_date, bs.backup_finish_date) > 1)';
0 commit comments