Hello everyone, we are receiving this error:
BulkInsert: System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Operation cancelled by user. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler) at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source) at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source) at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source) at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source) at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source) at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken) at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken) at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState) at OutSystems.NssBulkInsert.CssBulkInsert.SqlServerBulkInsert(IOSList recordList, String tableName, String columnsToIgnore, String referenceColumns, Boolean useTableLock, Dictionary`2 recordFields, String Catalog, String ExternalDatabaseConnectionName) ClientConnectionId:86117c99-7ad4-4dd2-bd63-4f702d3f65f4 Error Number:-2,State:0,Class:11
Could anyone help us?
Hi
Seems like query is not optimise and taking time to execute. Can you optimise it or try it in process so it will execute long or increase server timeout on module or specific server action.
Hope this will help you.
Hello Valentina,
As Rahul said this seems to be caused by a timeout.
Here are some possible reasons for this error:
The size of the data being inserted is too large, leading to the timeout.
The operation is being performed on a large table with a lot of indexes, leading to slow performance and eventual timeout.
To fix this issue, you can try the following:
Increase the timeout period for the bulk insert operation to allow for more time.
Optimize the performance of the server or network to reduce response times.
Consider breaking up the bulk insert operation into smaller batches to reduce the size of the data being inserted at once.
Hope it helps!
Paulo Rosário