sys.dm_database_copies (Windows Azure SQL Database)
Returns information about the database copy. The sys.dm_database_copies view is specific to Windows Azure SQL Database and is not supported in on-premise SQL Server.
The sys.dm_database_copies view contains the following fields:
| Column Name | Data Type | Description |
|---|---|---|
|
database_id |
int |
The ID of the current database in the |
|
start_date |
datetimeoffset |
The UTC time at a regional SQL Database datacenter when the database copying was initiated. |
|
modify_date |
datetimeoffset |
The UTC time at regional SQL Database datacenter when the database copying has completed. The new database is transactionally consistent with the source database as of this time. The completion information is updated every 5 minutes. |
|
percentage_complete |
real |
The percentage of bytes that have been copied. Values range from 0 to 100. SQL Database may automatically recover from some errors, such as failover, and restart the database copy. In this case, percentage_complete would restart from 0. |
|
error_code |
int |
When greater than 0, the code indicating the error that has occurred while copying. Value equals 0 if no errors have occurred. |
|
error_desc |
nvarchar(4096) |
Description of the error that occurred while copying. |
|
error_severity |
int |
Returns 16 if the database copy failed. |
|
error_state |
int |
Returns 1 if copy failed. |
This view is only available in the master database to the server-level principal login.
Use the sys.dm_database_copies view in the master database of the SQL Database server where the new database is being created. When the database copy completes successfully and the new database becomes ONLINE, the row in the sys.dm_database_copies view is removed automatically.