Azure Copy Database

–Commands for creating a copy of an existing Azure database and checking the progress of the copy.

/*
use master
go
CREATE DATABASE [DESTINATION-DB] AS COPY OF [SOURCE-SERVER].[SOURCE-DB];
go
*/

–select @@servername

/* – Whilst that copy is running open up another windows and check on its progress with the following:
use master
go
—-Check status of copying, Will say ONLINE when finished, until then it will say copying
select name, state_desc,collation_name
from sys.databases;

—-Check status of copying, more info, again check for ONLINE
select name, state_desc,collation_name, *
from sys.databases
–order by state_desc;

—much more information;what was source of copy, what server was the source
Select *
from sys.dm_database_copies;

Select *
from sys.dm_operation_status
*/

/* -After some days/weeks drop the copy of the database
use master
go
DROP DATABASE [DESTINATION-DB]
GO
*/