Tuesday, August 11, 2020

Create Azure SQL Staging | Testing Database

 Create Azure SQL Staging | Testing Database


We can do that by copying the current production database on either the same server or a different server using one of the following ways :

1- Using Azure Portal :

Azure SQL >> From the top bar click Copy >> then follow the wizard 

==================

2- Using Transact-SQL:

- Log into the Master database and excute this script:

CREATE DATABASE [StagingDatabaseName] AS COPY OF MyServerName.[SourceDatabaseName]

- To monitor the Progress:

          SELECT * FROM sys.dm_database_copies

==================

3- Using Azure CLI :

az sql db copy --dest-name "CopyOfMySampleDatabase" --dest-resource-group "myResourceGroup" --dest-server $targetserver `

    --name "<databaseName>" --resource-group "<resourceGroup>" --server $sourceserver

==================

4- Using PowerShell:

New-AzSqlDatabaseCopy -ResourceGroupName "<resourceGroup>" -ServerName $sourceserver -DatabaseName "<databaseName>" `

    -CopyResourceGroupName "myResourceGroup" -CopyServerName $targetserver -CopyDatabaseName "CopyOfMySampleDatabase"

1 comment:

Anonymous said...

The food shortage in Michigan? - stillcasino
› › Michigan › › Michigan › Aug 30, 메리트카지노 2021 — Aug 30, 2021 ミスティーノ Michigan's food insecurity in Michigan has been dramatically reducing. The Food and Drug Administration announced it is starvegad recommending an end to the food