Lesson Learned #267: Rename failed for Database ‘XXX’ in Azure SQL Database

This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .

Our customer got the following errror message "The operation cannot be performed since the database 'digordercontrol-db-test' is in a replication relationship. (Microsoft SQL Server, Error: 40680)" trying to rename a database. 

 

Our customer got the following error message using SQL Server Management Studio trying to rename a database. 

 

TITLE: Microsoft SQL Server Management Studio
------------------------------

Unable to rename XXX. (ObjectExplorer)

------------------------------
ADDITIONAL INFORMATION:

Rename failed for Database 'XXX'. (Microsoft.SqlServer.Smo)

For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.46437.65+(SMO-master-A)&Evtsrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Rename+Database&LinkId=20476

------------------------------

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

The operation cannot be performed since the database 'XXX' is in a replication relationship. (Microsoft SQL Server, Error: 40680)

For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-40680-database-engine-error

 

Solution

 

This error ocurred when the database is configured in an active geo replication relationship and a failover group. To fix this problem it is needed to remove the database from the active geo replication and failover group to be able to rename the database.

 

 

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.