Skip to content

Commit

Permalink
NumDatabases includes those already marked as unreachable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
garyhuntddn authored May 6, 2024
1 parent 9acc750 commit f07681d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sp_BlitzIndex.sql
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ ELSE
ELSE @DatabaseName END;
END;

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);
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');
SET @msg = N'Number of databases to examine: ' + CAST(@NumDatabases AS NVARCHAR(50));
RAISERROR (@msg,0,1) WITH NOWAIT;

Expand Down

0 comments on commit f07681d

Please sign in to comment.