【发布时间】:2016-11-18 21:00:12
【问题描述】:
我目前在 EF 迁移中运行 SQL() 命令时遇到 SQL 超时。
情况: 我正在用一个表替换一堆(> 50)表,并且需要将这些表中的数据转换为我将要放入新表中的数据。我按以下方式组织了迁移:
1.创建新表。
- 在同一迁移中,使用 SQL() 函数运行迁移数据的 sql 脚本。
3.删除所有旧表。
目前,迁移出现以下错误:
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
错误发生在我为他们提供安装程序的环境中,他们在没有我参与的情况下运行它,因此我无法手动运行单个迁移,并在中间暂停以运行 SQL 脚本。
有没有办法改变连接的超时时间,或者解决这个问题?
环境:
EF 6.0 代码优先
SQL Server 2012
【问题讨论】:
标签: entity-framework entity-framework-migrations