SQL Command Timeout

We are receiving the following Uipath error when we run a stored procedure. It only occurs when the result set takes over 30 seconds to return. We have checked SQL timeout settings, execution etc. and they are set as expected.

Error and stack trace below.

E:\CQRbot\Bots>ECHO — SAMPLE Change the atMonthOffset argument to the number o
f days from today to June 5
— SAMPLE Change the atMonthOffset argument to the number of days from today to
June 5

xe” /file:“E:\CQRbot\XAML\Qbot_CQR.xaml” /input:“{‘atExcelFile’:‘AOSM(QUA)102538
XAML System.Data.SqlClient.SqlException: Timeout expired. The timeout period el
apsed prior to completion of the operation or the server is not responding. —>
System.ComponentModel.Win32Exception: The wait operation timed out
— End of inner exception stack trace —

Server stack trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception , Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect 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.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSou
rce1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at UiPath.Database.DatabaseConnection.Execute(String sql, Dictionary2 parame
ters, CommandType commandType)
at UiPath.Database.Activities.ExecuteNonQuery.<>c__DisplayClass34_0.b__0()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(
IntPtr md, Object args, Object server, Object& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMe
ssage msg, IMessageSink replySink)

Exception rethrown at [0]:
at UiPath.Database.Activities.ExecuteNonQuery.EndExecute(AsyncCodeActivityCon
text context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.F
inishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.Complete
AsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager boo
Press any key to continue . . .

1 Like

Hi Thom!
Please check this post:

Connect Timeout is only for the connection.
In this case, this is command Timeout that should be increase, but it is not possible in the connection string nor in the Execute Query activity…

You will have to specify the command time out period explicitly for the SPs running for long time.
Use below code to build the connection and run a stored proc.
CallStoredProcedure.xaml (10.6 KB)



Timeout property not working for Execute Query activity…Can anyone help…