7 Şubat 2015 Cumartesi

The operation cannot be performed on database "your_database_name" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group. ALTER DATABASE statement failed. (Microsoft SQL Server, Error: 1468)

ERROR:
The operation cannot be performed on database "your_database_name" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group. ALTER DATABASE statement failed. (Microsoft SQL Server, Error: 1468)

DESCRIPTION:
If you try to delete a database before removing it from an AlwaysOn Availability Group, then this error occurs.

SOLUTION:
To avoid from this problem, first you should remove the database from the Availability Group that contains it and then delete the database.