Timeout when using SqlBulkCopy


For certain size of data, SqlBulkCopy.WriteToServer() may throw a timeout exception, although it won’t happen when MARS is turned on.


The problem is caused by a bug in the code for handling some boundary scenarios. The workaround is to apply this patch:


http://support.microsoft.com/kb/913177/

Comments (4)

  1. I noticed with SQL Server Integration Services if I use the SQL Server Destination and my data flow doesn’t…

  2. I’m still getting a SQLBulkCopy Timeout – I installed the hotfix, set the BatchSize and Timeout properties on the SQL Bulk Copy class –  but to no avail – has anyone tried anything else??

  3. mateusvelloso says:

    We tried the fix and seems we are still having the same issue. Anyone else across the same problem? Suggestions?

    Thanks

  4. Paul S says:

    I’m having exactly the opposite problem; when the target table is locked by another process, SqlBulkCopy doesn’t throw the SqlTimeout exception until after the lock is released*.

    While the lock is held by the other SPID, WriteToServer will wait indefinitely, no matter what the BulkCopyTimeout is set to.

    • Actually, it does the first time it’s called. All subsequent calls, though, fail to throw the SqlTimeout exception in a timely manner.
Skip to main content