0

This is the code to create a database copy in Azure using service management api's

SqlManagementClient sqlClient = new SqlManagementClient sqlClient ();
DatabaseCopyCreateParameters newDatabaseParameters = new DatabaseCopyCreateParameters()
                    {
                        IsContinuous = true,
                        PartnerDatabase = srcDB
                        PartnerServer = srcserver
                    };
sqlClient.DatabaseCopies.Create(dbservername, dbname, newDatabaseParameters);

It got created in the location say "east asia".

As you can see I am not providing any location details, then how it is created in this location?

hokkaidi
  • 858
  • 6
  • 19

2 Answers2

0

Location is decided based on the server location. Since my server is in East Asia, Obviously db will be in East Asia

-1

You can avoid this by copying the database using T-SQL as explained below:

-- Execute on the master database of the target server (server2)
-- Start copying from Server1 to Server2
CREATE DATABASE Database1_copy AS COPY OF server1.Database1;

For more information, click here.

Hope this helps.

Alberto Morillo
  • 13,893
  • 2
  • 24
  • 30