From time to time I need to do those kind of things, so I want to keep it posted here to no to forget them.
If I need to rename a database which is in Azure Database, I have two options to do this, bot options are related with Management Studio, so keep in min to have in your laptop and keep in mind that your IP has to be allowed to connect to the database server.
Rename with command-line – TSQL
- Connect with SQL Server Management Studio to your Azure database server
- Right-click on the master database and select New Query
- In the New Query window type
ALTER DATABASE [dbname] MODIFY NAME = [newdbname]
. (Make sure you include the square brackets around both database names.)
Rename with a GUI – SQL Server Management Studio
- Connect with SQL Server Management Studio
- Make sure Object Explorer pane is open.
- Click on the database name (as the rename option from the dropdown will be greyed out) and type in the new name.
- The Azure Portal should show the reflected the change almost immediately.