CREATE AVAILABILITY GROUP
defines availability group (no row flow)
What changes
- Input
- catalog
- Output or change
- catalog: availability group
Syntax at a glance
CREATE AVAILABILITY GROUP group_name WITH (<with_option_spec> [ ,...n ] ) FOR [ DATABASE database_name [ ,...n ] ] REPLICA ON <add_replica_spec> [ ,...n ] AVAILABILITY GROUP ON <add_availability_group_spec> [ ,...2 ] [ LISTENER 'dns_name' ( <listener_option> ) ] [ ; ]
Work example
A service needs a reviewed availability group for database failover.
Check replica endpoints, failover mode, commit mode, listener plan, quorum, and recovery objectives before the change.
Check your work Every replica has a documented role and the planned failover meets the service recovery target.
Open Microsoft Learn for full syntax, permissions, and details for your version.