I need a query to get the user databases not added or configured for Always On Availability Groups in SQL Server 2014.


You can use sys.databases which has a column called group_database_id. If this column is null then the database is not participating in an availability group. To only get user databases, restrict the query to database_id > 4.

SELECT name From sys.databases WHERE database_id > 4 AND group_database_id IS NULL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.