I want to rename DB
I want to change the DB name after restoring the DB and restoring the DB name in order to use the restored DB as the production database.
If the DB name can not be changed, there is a possibility that it is necessary to change the connection string after the DB restore.


This feature is now fully supported in Managed Instance: https://docs.microsoft.com/azure/sql-database/sql-database-managed-instance-index#new-and-preview-features
2 comments
-
Ewen Miller commented
This is not supported in DBs which are configured with Geo-replicas. Really do need this. I am surprised by this - would have thought the DB id would be used rather than the Name label. Perhaps in the replica, the DB ID used on the Primary can be communicated to the secondary, and if not used, the secondary can be made to use the same DB ID?
-
sp_rename and ALTER DATABASE MODIFY NAME are not supported in Managed Instance, see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-index#new-and-preview-features