You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/sql-database/sql-database-copy.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,19 +27,19 @@ A database copy is a snapshot of the source database as of the time of the copy
27
27
28
28
When you copy a database to the same SQL Database server, the same logins can be used on both databases. The security principal you use to copy the database becomes the database owner on the new database. All database users, their permissions, and their security identifiers (SIDs) are copied to the database copy.
29
29
30
-
When you copy a database to a different SQL Database server, the security principal on the new server becomes the database owner on the new database. If you use [contained database users](sql-database-manage-logins.md) for data access, ensure that both the primary and secondary databases always have the same user credentials, so that after the copy is complete you can immediately access it with the same credentials.
30
+
When you copy a database to a different SQL Database server, the security principal on the target server that initiated the copy operation becomes the owner of the new database. Using [contained database users](sql-database-manage-logins.md) for data access ensures that the copied database has the same user credentials, so that after the copy is complete you can immediately access it with the same credentials.
31
31
32
-
If you use [Azure Active Directory](../active-directory/fundamentals/active-directory-whatis.md), you can completely eliminate the need for managing credentials in the copy. However, when you copy the database to a new server, the login-based access might not work, because the logins do not exist on the new server. To learn about managing logins when you copy a database to a different SQL Database server, see [How to manage Azure SQL database security after disaster recovery](sql-database-geo-replication-security-config.md).
32
+
If you use server level logins for data access and copythe database to a new server, the login-based access might not work. This can happen because the logins do not exist on the new server, or because their passwords and security identifiers (SIDs) are different. To learn about managing logins when you copy a database to a different SQL Database server, see [How to manage Azure SQL database security after disaster recovery](sql-database-geo-replication-security-config.md).
33
33
34
-
After the copying succeeds and before other users are remapped, only the login that initiated the copying, the database owner, can log in to the new database. To resolve logins after the copying operation is complete, see [Resolve logins](#resolve-logins).
34
+
After the copying succeeds and before other users are remapped, only the login that initiated the copy operation can log in to the new database. To resolve logins and establish data access after the copying operation is complete, see [Resolve logins](#resolve-logins).
35
35
36
36
## Copy a database by using the Azure portal
37
37
38
38
To copy a database by using the Azure portal, open the page for your database, and then click **Copy**.
## Copy a database by using PowerShell or Azure CLI
43
43
44
44
To copy a database, use the following examples.
45
45
@@ -105,7 +105,7 @@ If you want to see the operations under deployments in the resource group on the
105
105
106
106
## Copy a database by using Transact-SQL
107
107
108
-
Log in to the master database with the server-level principal login or the login that created the database you want to copy. For database copying to succeed, logins that are not the server-level principal must be members of the dbmanager role. For more information about logins and connecting to the server, see [Manage logins](sql-database-manage-logins.md).
108
+
Log in to the master database with the server administrator login or the login that created the database you want to copy. For database copying to succeed, logins that are not the server administrator must be members of the `dbmanager` role. For more information about logins and connecting to the server, see [Manage logins](sql-database-manage-logins.md).
109
109
110
110
Start copying the source database with the [CREATE DATABASE ... AS COPY OF](https://docs.microsoft.com/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current#copy-a-database) statement. Executing this statement initiates the database copying process. The T-SQL statement continues running until the database copy operation is complete.
111
111
@@ -115,7 +115,7 @@ Start copying the source database with the [CREATE DATABASE ... AS COPY OF](http
115
115
116
116
### Copy a SQL database to the same server
117
117
118
-
Log in to the master database with the server-level principal login or the login that created the database you want to copy. For database copying to succeed, logins that are not the server-level principal must be members of the dbmanager role.
118
+
Log in to the master database with the server administrator login or the login that created the database you want to copy. For database copying to succeed, logins that are not the server administrator must be members of the `dbmanager` role.
119
119
120
120
This command copies Database1 to a new database named Database2 on the same server. Depending on the size of your database, the copying operation might take some time to complete.
121
121
@@ -126,7 +126,7 @@ This command copies Database1 to a new database named Database2 on the same serv
126
126
127
127
### Copy a SQL database to a different server
128
128
129
-
Log in to the master database of the destination server, the SQL Database server where the new database is to be created. Use a login that has the same name and password as the database owner of the source database on the source SQL Database server. The login on the destination server must also be a member of the dbmanager role or be the server-level principal login.
129
+
Log in to the master database of the destination server, the SQL Database server where the new database is to be created. Use a login that has the same name and password as the database owner of the source database on the source SQL Database server. The login on the destination server must also be a member of the `dbmanager` role or be the server administrator login.
130
130
131
131
This command copies Database1 on server1 to a new database named Database2 on server2. Depending on the size of your database, the copying operation might take some time to complete.
132
132
@@ -140,7 +140,7 @@ CREATE DATABASE Database2 AS COPY OF server1.Database1;
140
140
141
141
### Copy a SQL database to a different subscription
142
142
143
-
You can use the steps described in the previous section to copy your database to a SQL Database server in a different subscription using T-SQL. Make sure you use a login that has the same name and password as the database owner of the source database and it is a member of the dbmanager role or is the server-level principal login.
143
+
You can use the steps described in the previous section to copy your database to a SQL Database server in a different subscription using T-SQL. Make sure you use a login that has the same name and password as the database owner of the source database and it is a member of the `dbmanager` role or is a server administrator login.
144
144
145
145
> [!NOTE]
146
146
> The [Azure portal](https://portal.azure.com), PowerShell, and Azure CLI do not support database copy to a different subscription. For this scenario, use T-SQL as described in the previous sections.
0 commit comments