Skip to content

Target database is in an availability group #20

Description

@mjhf19

I get the error below when running the following command against a SQL Instance which contains any databases configured for AlwaysOn

EXEC [dbo].[sp_DBPermissions] @dbname = 'ALL', @output = 'report';

"The target database ('db_name') is in an availability group and is currently accessible for connections when the application intent is set to read only. For more information about application intent, see SQL Server Books Online."

This would require excluding databases in sys.dm_hadr_database_replica_states with is_primary_replica = 0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions