Skip to content

Commit

Permalink
Use of DB_NAME()
Browse files Browse the repository at this point in the history
For consistency with the INSERT query above - DB_NAME should be used in both places
  • Loading branch information
garyhuntddn committed May 6, 2024
1 parent 9acc750 commit fc8cc91
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 @@ -829,7 +829,7 @@ IF @GetAllDatabases = 1
IF EXISTS (SELECT * FROM sys.all_objects o INNER JOIN sys.all_columns c ON o.object_id = c.object_id AND o.name = 'dm_hadr_availability_replica_states' AND c.name = 'role_desc')
BEGIN
SET @dsql = N'UPDATE #DatabaseList SET secondary_role_allow_connections_desc = ''NO'' WHERE DatabaseName IN (
SELECT d.name
SELECT DB_NAME(d.database_id)
FROM sys.dm_hadr_availability_replica_states rs
INNER JOIN sys.databases d ON rs.replica_id = d.replica_id
INNER JOIN sys.availability_replicas r ON rs.replica_id = r.replica_id
Expand Down

0 comments on commit fc8cc91

Please sign in to comment.