Retryable SQL Error
As indicate in post Azure SQL transient errors by Mattias Karlsson, the following SQL errors are safe to retry:
Error | Error Number |
---|---|
SqlErrorInstanceDoesNotSupportEncryption | 20 |
SqlErrorConnectedButLoginFailed | 64 |
SqlErrorUnableToEstablishConnection | 233 |
SqlErrorTransportLevelErrorReceivingResult | 10053 |
SqlErrorTransportLevelErrorWhenSendingRequestToServer | 10054 |
SqlErrorNetworkRelatedErrorDuringConnect | 10060 |
SqlErrorDatabaseLimitReached | 10928 |
SqlErrorResourceLimitReached | 10929 |
SqlErrorServiceErrorEncountered | 40197 |
SqlErrorServiceBusy | 40501 |
SqlErrorServiceRequestProcessFail | 40540 |
SqlErrorServiceExperiencingAProblem | 40545 |
SqlErrorDatabaseUnavailable | 40613 |
SqlErrorOperationInProgress | 40627 |
I am not quite sure if I want to retry SqlErrorConnectedButLoginFailed or SqlErrorInstanceDoesNotSupportEncryption as these errors sound determined to me. But I guess it is based on the context. For a complete list of error codes, refer to Microsoft documentation here. The Connectivity guidance is worth reading as well.