-> I tried renaming an Azure SQL database JBDB and got below error,


TITLE: Microsoft SQL Server Management Studio
Unable to rename JBDB_old. (ObjectExplorer)
ADDITIONAL INFORMATION:
Rename failed for Database ‘JBDB’. (Microsoft.SqlServer.Smo)
For help, …..
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The operation cannot be performed since the database ‘JBDB’ is in a replication relationship. (Microsoft SQL Server, Error: 40680)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.2148&EvtSrc=MSSQLServer&EvtID=40680&LinkId=20476
-> Error explains that this database is in a replication relationship. Let’s check if it is part of failover group,

-> Database JBDB is part of failover group. Lets remove this database from failover group and try renaming it.




-> Once removed from failover group. Open Azure SQL Database and click on database JBDB. Open “Geo-Replication” and stop it for JBDB database.

-> Try renaming the database and it will complete this time.

Thank You,
Vivek Janakiraman
Disclaimer:
The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.