Skip to content

Commit f07681d

Browse files
authored
NumDatabases includes those already marked as unreachable
There is code to identify databases which can't be analysed that results in secondary_role_allow_connections_desc = 'NO', but these aren't excluded from the NumDatabases count
1 parent 9acc750 commit f07681d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sp_BlitzIndex.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ ELSE
894894
ELSE @DatabaseName END;
895895
END;
896896

897-
SET @NumDatabases = (SELECT COUNT(*) FROM #DatabaseList AS D LEFT OUTER JOIN #Ignore_Databases AS I ON D.DatabaseName = I.DatabaseName WHERE I.DatabaseName IS NULL);
897+
SET @NumDatabases = (SELECT COUNT(*) FROM #DatabaseList AS D LEFT OUTER JOIN #Ignore_Databases AS I ON D.DatabaseName = I.DatabaseName WHERE I.DatabaseName IS NULL AND ISNULL(D.secondary_role_allow_connections_desc, 'YES') != 'NO');
898898
SET @msg = N'Number of databases to examine: ' + CAST(@NumDatabases AS NVARCHAR(50));
899899
RAISERROR (@msg,0,1) WITH NOWAIT;
900900

0 commit comments

Comments
 (0)