Azure SQL 服务器复制数据库脚本失败

Azure SQL Server copy database script failing

CREATE DATABASE {0} 
AS COPY OF {1} ( SERVICE_OBJECTIVE = 'S2' )

Execution timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. CREATE DATABASE AS Copy of operation failed. Internal service error.

您有超时异常,这表明完成命令的时间比您的超时时间长。查看连接字符串以查看连接超时。将其更改为更大的值。

根据需要花费的时间,您可以创建更大的数据库 (S3),然后再将其缩小。创建数据库时检查 DTU 使用率是否为 100%。

如果通过连接字符串设置更高的连接超时不起作用,您可能需要检查 SqlCommand.

上的 Command Timout 设置

您也可以使用任何可用的 ORM 框架来设置它,尽管 属性 的名称可能有所不同。