Adding an Exchange DAG fails with the error "Cannot insert a resource container. A database error has occurred"
Problem
Adding an Exchange DAG (Database Availability Group) fails with the following:
Figure 1:
If the DAG name (EX-DAG) was used adding another cluster node, then adding the Exchange DAG name (EX-DAG) using the same name will fail with "Cannot insert a resource container. A database error has occurred"
Error Message
ERROR: Message: Cannot insert a resource container
ERROR: Reason: A database error has occurred
ERROR: DataAccessBEServer ResourceContainer_Insert: [ResourceContainer_Save]: Insert ResourceContainer caught an error: The DELETE statement conflicted with the REFERENCE constraint "FK_ResourceContainerGroupAssociation_ResourceContainer". The conflict occurred in database "BEDB", table "dbo.ResourceContainerGroupAssociation", column 'RCKey'.
Cause
This may occur if the DAG name is already added as another resource - i.e. cluster resource.
Solution
1. Delete the existing resource container with the DAG name.
2. Re-create the DAG resource by selecting Microsoft Exchange DAG in the "Add Server" wizard.