Question:
I’ve created azure database using powershell. Now i want to rename the database using powershell. My purpose to do this is creating temporary database, then deploy database release to temp DB,then rename production db to any other name, finaly rename Temp Db to production db
Answer:
To achieve this, you can use the cmdlet “Set-AzureSqlDatabase”, the parameter “-NewDatabaseName” permits to set a new name for a specified database name.
1 2 |
Set-AzureSqlDatabase -ServerName 'myservername' -DatabaseName 'mydb' -NewDatabaseName 'newNameForTheDb' |
Here is the documentation : https://msdn.microsoft.com/fr-fr/library/dn546732.aspx