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_Blitz.sql
-64Lines changed: 0 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -6383,38 +6383,6 @@ IF @ProductVersionMajor >= 10
6383
6383
HAVING SUM(1) > 0 OPTION (RECOMPILE)';
6384
6384
END;
6385
6385
6386
-
IFNOTEXISTS ( SELECT1
6387
-
FROM #SkipChecks
6388
-
WHERE DatabaseName ISNULLAND CheckID =38 )
6389
-
BEGIN
6390
-
6391
-
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 38) WITHNOWAIT;
6392
-
6393
-
EXECdbo.sp_MSforeachdb'USE [?];
6394
-
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
6395
-
INSERT INTO #BlitzResults
6396
-
(CheckID,
6397
-
DatabaseName,
6398
-
Priority,
6399
-
FindingsGroup,
6400
-
Finding,
6401
-
URL,
6402
-
Details)
6403
-
SELECT DISTINCT 38,
6404
-
N''?'',
6405
-
110,
6406
-
''Performance'',
6407
-
''Active Tables Without Clustered Indexes'',
6408
-
''https://www.brentozar.com/go/heaps'',
6409
-
(''The ['' + DB_NAME() + ''] database has heaps - tables without a clustered index - that are being actively queried.'')
6410
-
FROM [?].sys.indexes i INNER JOIN [?].sys.objects o ON i.object_id = o.object_id
6411
-
INNER JOIN [?].sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id
6412
-
INNER JOIN sys.databases sd ON sd.name = N''?''
6413
-
LEFT OUTER JOIN [?].sys.dm_db_index_usage_stats ius ON i.object_id = ius.object_id AND i.index_id = ius.index_id AND ius.database_id = sd.database_id
6414
-
WHERE i.type_desc = ''HEAP'' AND COALESCE(NULLIF(ius.user_seeks,0), NULLIF(ius.user_scans,0), NULLIF(ius.user_lookups,0), NULLIF(ius.user_updates,0)) IS NOT NULL
6415
-
AND sd.name <> ''tempdb'' AND sd.name <> ''DWDiagnostics'' AND o.is_ms_shipped = 0 AND o.type <> ''S'' OPTION (RECOMPILE)';
6416
-
END;
6417
-
6418
6386
IFNOTEXISTS ( SELECT1
6419
6387
FROM #SkipChecks
6420
6388
WHERE DatabaseName ISNULLAND CheckID =164 )
@@ -6443,38 +6411,6 @@ IF @ProductVersionMajor >= 10
6443
6411
FROM [?].sys.plan_guides g CROSS APPLY fn_validate_plan_guide(g.plan_guide_id) OPTION (RECOMPILE)';
6444
6412
END;
6445
6413
6446
-
IFNOTEXISTS ( SELECT1
6447
-
FROM #SkipChecks
6448
-
WHERE DatabaseName ISNULLAND CheckID =39 )
6449
-
BEGIN
6450
-
6451
-
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 39) WITHNOWAIT;
6452
-
6453
-
EXECdbo.sp_MSforeachdb'USE [?];
6454
-
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
6455
-
INSERT INTO #BlitzResults
6456
-
(CheckID,
6457
-
DatabaseName,
6458
-
Priority,
6459
-
FindingsGroup,
6460
-
Finding,
6461
-
URL,
6462
-
Details)
6463
-
SELECT DISTINCT 39,
6464
-
N''?'',
6465
-
150,
6466
-
''Performance'',
6467
-
''Inactive Tables Without Clustered Indexes'',
6468
-
''https://www.brentozar.com/go/heaps'',
6469
-
(''The ['' + DB_NAME() + ''] database has heaps - tables without a clustered index - that have not been queried since the last restart. These may be backup tables carelessly left behind.'')
6470
-
FROM [?].sys.indexes i INNER JOIN [?].sys.objects o ON i.object_id = o.object_id
6471
-
INNER JOIN [?].sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id
6472
-
INNER JOIN sys.databases sd ON sd.name = N''?''
6473
-
LEFT OUTER JOIN [?].sys.dm_db_index_usage_stats ius ON i.object_id = ius.object_id AND i.index_id = ius.index_id AND ius.database_id = sd.database_id
6474
-
WHERE i.type_desc = ''HEAP'' AND COALESCE(NULLIF(ius.user_seeks,0), NULLIF(ius.user_scans,0), NULLIF(ius.user_lookups,0), NULLIF(ius.user_updates,0)) IS NULL
6475
-
AND sd.name <> ''tempdb'' AND sd.name <> ''DWDiagnostics'' AND o.is_ms_shipped = 0 AND o.type <> ''S'' OPTION (RECOMPILE)';
0 commit comments