我目前在EF迁移中运行SQL()命令时遇到SQL超时。
情况:我要用一个表替换一堆(> 50)表,并且需要将要放入新表中的那些表中的数据转换。我通过以下方式组织了迁移:
1.创建新表。
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