You execute the method WriteToServer, and the following error is thrown:
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
// Oops! The specified bulkCopyTimeout value is to low!
bulkCopyTimeout = 1;
using (var connection = new SqlConnection(My.Config.ConnectionStrings.BulkOperations))
{
connection.Open();
using (var bulkCopy = new SqlBulkCopy(connection))
{
// SET BulkCopyTimeout value.
bulkCopy.BulkCopyTimeout = bulkCopyTimeout;
bulkCopy.DestinationTableName = destinationName;
bulkCopy.WriteToServer(dt);
}
}
The bulkCopyTimeout is by batch, not for the whole bulk operation.