Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rename azure sql database using powershell

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

like image 762
Dimuth Lochana Avatar asked Dec 11 '22 15:12

Dimuth Lochana


1 Answers

To achieve this, you can use the cmdlet "Set-AzureSqlDatabase", the parameter "-NewDatabaseName" permits to set a new name for a specified database name.

Set-AzureSqlDatabase -ServerName 'myservername' -DatabaseName 'mydb' -NewDatabaseName 'newNameForTheDb' 

Here is the documentation : https://msdn.microsoft.com/fr-fr/library/dn546732.aspx

like image 89
Thibaut Ranise Avatar answered Dec 26 '22 04:12

Thibaut Ranise