SQL retry?

I have the following sequence in my flow,

[Gather data]
{ connect to SQL server}
{execute query & save to datatable}
{Disconnect from SQL server}

my issue is, either our server is to slow to respond or the query itself isn’t great, but what happens is this normally causes a crash on the first run, and I have to run the bot 2-3 times to get it to run.

What I would like to do, is set it so it will basically try again, instead of throwing an error message box and ending the process.

If connection & query & disconnect successful = continue
Else : try again

Whats the best way to achieve this?

Many thanks

You can either use retry scope/ try catch/state machine, in all cases you should have counter max 3 (make sure it won’t go to I finite loop) and you can execute query in retry scope.


Thanks Divyashreem.

1 Like