Skip to content

Commit 543d497

Browse files
Merge pull request #36007 from David-Engel/patch-3
Update connection settings and clarify Command Timeout
2 parents 5a97d62 + 43b7f96 commit 543d497

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

azure-sql/database/troubleshoot-common-connectivity-issues.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: Working with Transient Errors
33
description: Learn how to troubleshoot, diagnose, and prevent a SQL connection error or transient error when connecting to Azure SQL Database, SQL database in Fabric, Azure SQL Managed Instance, and Azure Synapse Analytics.
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
6-
ms.reviewer: sureshka, mathoma, vanto
7-
ms.date: 06/16/2025
6+
ms.reviewer: sureshka, davidengel, mathoma, vanto
7+
ms.date: 12/04/2025
88
ms.service: azure-sql-database
99
ms.subservice: development
1010
ms.topic: troubleshooting
@@ -138,7 +138,6 @@ When you build the [connection string](/dotnet/api/system.data.sqlclient.sqlconn
138138
- **ConnectRetryCount**:  Default is **1**. The range is **0** through **255**.
139139
- **ConnectRetryInterval**:  Default is **10** seconds. The range is **1** through **60**.
140140
- **Connection Timeout**:  Default is **15** seconds. The range is **0** through **2147483647**.
141-
- **Command Timeout**:  Default is **30** seconds. The range is **0** through **2147483647**.
142141

143142
The connection retry settings (**ConnectRetryCount** and **ConnectRetryInterval**) apply to connection resiliency. Connection resiliency includes the following distinct types:
144143

@@ -186,7 +185,7 @@ For example, if the count is 3 and the interval is 10 seconds, a timeout of only
186185

187186
4:10:20 - Retry 3
188187

189-
This isn't the initial connection. Therefore, **Connection Timeout** doesn't apply. However, because the connection recovery occurs during command execution, the **Command Timeout** setting does apply. The **Command Timeout** default is 30 seconds. Although, connection recovery is fast in typical circumstances, an intermittent outage, could cause the recovery to take some of the command execution time.
188+
This isn't the initial connection. Therefore, **Connection Timeout** doesn't apply. However, because the connection recovery occurs during command execution, the **Command Timeout** property of the [SqlCommand](/dotnet/api/system.data.sqlclient.sqlcommand.commandtimeout) executing the statement does apply. The **Command Timeout** default is 30 seconds. Although, connection recovery is fast in typical circumstances, an intermittent outage, could cause the recovery to take some of the command execution time.
190189

191190
For this scenario, if you want to take full advantage of idle connection recovery retries, your chosen values should satisfy the following condition:
192191
`Command Timeout > (ConnectRetryCount - 1) * ConnectionRetryInterval`
@@ -205,7 +204,7 @@ Also, consider that the command itself requires time to execute after the connec
205204
The **ConnectRetryCount** and **ConnectRetryInterval** parameters let your **SqlConnection** object retry the connect operation without telling or bothering your program, such as returning control to your program. The retries can occur in the following situations:
206205

207206
- SqlConnection.Open method call
208-
- SqlConnection.Execute method call
207+
- SqlCommand.Execute* method calls
209208

210209
There is a subtlety. If a transient error occurs while your *query* is being executed, your **SqlConnection** object doesn't retry the connect operation. It certainly doesn't retry your query. However, **SqlConnection** very quickly checks the connection before sending your query for execution. If the quick check detects a connection problem, **SqlConnection** retries the connect operation. If the retry succeeds, your query is sent for execution.
211210

0 commit comments

Comments
 (0)