SqlClient.SqlException:等待操作超时 [英] SqlClient.SqlException: The wait operation timed out
问题描述
目前,我正在试图创建大量的测试数据,使用类似的代码如下...
I'm currently trying to create a large amount of test data with numerous insert statements using code similar to below...
using (var connection = new SqlConnection(_connectionString))
{
using (var command = new SqlCommand(query.ToString(), connection))
{
try
{
connection.Open();
command.ExecuteNonQuery();
return true;
}
catch (Exception e)
{
......
}
}
}
我的问题是,我不断收到一个错误
My problem is that I keep getting an error
等待操作超时
然而,当我运行从SQL Server Management Studio中失败的SQL语句,它在执行小于100ms。错误似乎总是发生,同时插入目前有47738476行是1,970,696Kb规模最大的表。
and yet when I run the SQL statement that failed from within SQL Server Management Studio, it executes in less than 100ms. The error always seems to occur whilst inserting into the largest table which currently has 47,738,476 rows and is 1,970,696Kb in size.
我使用的:
Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)
Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
任何,帮助将最欣赏
Any, help would be most appreciated.
推荐答案
免责声明:它可能不是一个答案,但它解决了这个问题:)
Disclaimer: It may not be an answer but it solves the problem :)
使用展鹏SQL数据发生器
Use Redgate Sql Data Generator
的 http://www.red-gate.com/products/sql-development/sql-data-generator/
据是不是免费的,但它是全功能的试用了一些日子,它会做什么,我想
实现你的工作。
It is not free but it is fully functional trial for some days and it will do the work for you what i want to achieve.
它有很多的选项并产生真正的寻找数据。
It had lot of option and generate real looking data.
这篇关于SqlClient.SqlException:等待操作超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!