Skip to content

Commit 8965572

Browse files
authored
Merge pull request #3511 from garyhuntddn/garyhuntddn-patch-2
NumDatabases includes those already marked as unreachable
2 parents 0fba643 + f07681d commit 8965572

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)