This topic has not yet been rated - Rate this topic

DROP AVAILABILITY GROUP (Transact-SQL)

Removes the specified availability group and all of its replicas. Dropping an availability group also deletes the associated availability group listener, if any.

Topic link icon Transact-SQL Syntax Conventions


          

DROP AVAILABILITY GROUP group_name 
[ ; ]
        
group_name

Specifies the name of the availability group to be dropped.

Executing DROP AVAILABILITY GROUP requires that HADR service is enabled on the server instance. For more information, see Enable and Disable AlwaysOn Availability Groups (SQL Server).

DROP AVAILABILITY GROUP cannot be executed as part of batches or within transactions. Also, expressions and variables are not supported.

You can drop an availability group from any Windows Server Failover Clustering (WSFC) node that possesses the correct security credentials for the availability group. This enables you to delete an availability group when none of its availability replicas remain.

For more information, see Remove an Availability Group (SQL Server).

Permissions

Requires ALTER AVAILABILITY GROUP permission on the availability group, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission. To drop an availability group that is not hosted by the local server instance you need CONTROL SERVER permission or CONTROL permission on that availability group.

The following example drops the AccountsAG availability group.

DROP AVAILABILITY GROUP AccountsAG;
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ