Skip to content

Commit 4f12a13

Browse files
authored
docs: SqlClient migration post-audit - VB fix, future opportunities, editorial pass (#36942)
1 parent cf6d289 commit 4f12a13

8 files changed

Lines changed: 245 additions & 245 deletions

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to troubleshoot, diagnose, and prevent a SQL connection e
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
66
ms.reviewer: sureshka, davidengel, mathoma, vanto
7-
ms.date: 12/04/2025
7+
ms.date: 03/24/2026
88
ms.service: azure-sql-database
99
ms.subservice: development
1010
ms.topic: troubleshooting
@@ -46,7 +46,7 @@ After a delay of several seconds, retry the connection.
4646

4747
- **A transient error occurs during a query command**
4848

49-
Do not immediately retry the command. Instead, after a delay, freshly establish the connection. Then retry the command.
49+
Don't immediately retry the command. Instead, after a delay, freshly establish the connection. Then retry the command.
5050

5151
<a id="j-retry-logic-transient-faults"></a>
5252

@@ -59,7 +59,7 @@ Client programs that occasionally encounter a transient error are more robust wh
5959
### Principles for retry
6060

6161
- If the error is transient, retry to open a connection.
62-
- Do not directly retry a `SELECT` statement that failed with a transient error. Instead, establish a fresh connection, and then retry the `SELECT`.
62+
- Don't directly retry a `SELECT` statement that failed with a transient error. Instead, establish a fresh connection, and then retry the `SELECT`.
6363
- When an `UPDATE` statement fails with a transient error, establish a fresh connection before you retry the `UPDATE`. The retry logic must ensure that either the entire database transaction finished or that the entire transaction is rolled back.
6464

6565
### Other considerations for retry
@@ -127,7 +127,10 @@ To make this test practical, your program recognizes a runtime parameter that ca
127127

128128
## .NET SqlConnection parameters for connection retry
129129

130-
If your client program connects to your database in Azure SQL Database by using the .NET Framework class **System.Data.SqlClient.SqlConnection**, use .NET 4.6.1 or a later version (or .NET Core) so that you can use its connection retry feature. For more information about this feature, see [SqlConnection.ConnectionString Property](/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring?view=netframework-4.8&preserve-view=true).
130+
If your client program connects to your database in Azure SQL Database by using the .NET class **Microsoft.Data.SqlClient.SqlConnection** or **System.Data.SqlClient.SqlConnection**, you can use connection retry features. For `System.Data.SqlClient`, use .NET Framework 4.6.1 or a later version (or .NET Core). For more information about this feature, see [SqlConnection.ConnectionString Property](/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring?view=netframework-4.8&preserve-view=true).
131+
132+
> [!NOTE]
133+
> `Microsoft.Data.SqlClient` is the recommended ADO.NET data provider for new application development. In addition to connection retry, it supports [configurable retry logic](/sql/connect/ado-net/configurable-retry-logic) for both connection and command retries. For more information, see [Introduction to the Microsoft.Data.SqlClient namespace](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace).
131134
132135
<!--
133136
2015-11-30, FwLink 393996 points to dn632678.aspx, which links to a downloadable .docx related to SqlClient and SQL Server 2014.
@@ -206,11 +209,11 @@ The **ConnectRetryCount** and **ConnectRetryInterval** parameters let your **Sql
206209
- SqlConnection.Open method call
207210
- SqlCommand.Execute* method calls
208211

209-
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.
212+
There's 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.
210213

211214
### Should ConnectRetryCount be combined with application retry logic
212215

213-
Suppose your application has robust custom retry logic. It might retry the connect operation four times. If you add **ConnectRetryInterval** and **ConnectRetryCount** =3 to your connection string, you will increase the retry count to 4 * 3 = 12 retries. You might not intend such a high number of retries.
216+
Suppose your application has robust custom retry logic. It might retry the connect operation four times. If you add **ConnectRetryInterval** and **ConnectRetryCount** =3 to your connection string, you increase the retry count to 4 * 3 = 12 retries. You might not intend such a high number of retries.
214217

215218
<a id="a-connection-connection-string"></a>
216219

@@ -255,7 +258,7 @@ For background information about configuration of ports and IP addresses in your
255258

256259
### Connection: ADO.NET 4.6.2 or later
257260

258-
If your program uses ADO.NET classes like **System.Data.SqlClient.SqlConnection** to connect to SQL Database, we recommend that you use .NET Framework version 4.6.2 or later.
261+
If your program uses ADO.NET classes like **System.Data.SqlClient.SqlConnection** to connect to SQL Database, we recommend that you use .NET Framework version 4.6.2 or later. For new applications, consider using [`Microsoft.Data.SqlClient`](/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace), which provides the same connectivity with enhanced features.
259262

260263
<a id="starting-with-adonet-462"></a>
261264

@@ -270,7 +273,7 @@ If your program uses ADO.NET classes like **System.Data.SqlClient.SqlConnection*
270273
- For SQL Database, reliability is improved when you open a connection by using the **SqlConnection.Open** method. The **Open** method now incorporates best-effort retry mechanisms in response to transient faults for certain errors within the connection timeout period.
271274
- Connection pooling is supported, which includes an efficient verification that the connection object it gives your program is functioning.
272275

273-
When you use a connection object from a connection pool, we recommend that your program temporarily closes the connection when it's not immediately in use. It's not expensive to reopen a connection, but it is to create a new connection.
276+
When you use a connection object from a connection pool, we recommend that your program temporarily closes the connection when it's not immediately in use. It's not expensive to reopen a connection, but it's to create a new connection.
274277

275278
If you use ADO.NET 4.0 or earlier, we recommend that you upgrade to the latest ADO.NET. As of August 2018, you can [download ADO.NET 4.6.2](https://devblogs.microsoft.com/dotnet/announcing-the-net-framework-4-7-2).
276279

azure-sql/database/troubleshoot-transaction-log-errors-issues.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Provides steps to troubleshoot transaction log issues in Azure SQL
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
77
ms.reviewer: mathoma
8-
ms.date: 06/13/2025
8+
ms.date: 03/24/2026
99
ms.service: azure-sql-database
1010
ms.subservice: development
1111
ms.topic: troubleshooting
@@ -20,7 +20,7 @@ monikerRange: "=azuresql-db"
2020
> * [Azure SQL Database](troubleshoot-transaction-log-errors-issues.md?view=azuresql-db&preserve-view=true)
2121
> * [Azure SQL Managed Instance](../managed-instance/troubleshoot-transaction-log-errors-issues.md?view=azuresql-mi&preserve-view=true)
2222
23-
You might see errors 9002 or 40552 when the transaction log is full and cannot accept new transactions. These errors occur when the database transaction log, managed by Azure SQL Database, exceeds thresholds for space and cannot continue to accept transactions. These errors are similar to issues with a full transaction log in SQL Server, but have different resolutions in SQL Server, Azure SQL Database, and Azure SQL Managed Instance.
23+
You might see errors 9002 or 40552 when the transaction log is full and can't accept new transactions. These errors occur when the database transaction log, managed by Azure SQL Database, exceeds thresholds for space and can't continue to accept transactions. These errors are similar to issues with a full transaction log in SQL Server, but have different resolutions in SQL Server, Azure SQL Database, and Azure SQL Managed Instance.
2424

2525
> [!NOTE]
2626
> **This article is focused on Azure SQL Database.** Azure SQL Database is based on the latest stable version of the Microsoft SQL Server database engine, so much of the content is similar, though troubleshooting options and tools might differ from SQL Server.
@@ -35,7 +35,7 @@ In Azure SQL Database, transaction log backups are taken automatically. For freq
3535

3636
Free disk space, database file growth, and file location are also managed, so the typical causes and resolutions of transaction log issues are different from SQL Server.
3737

38-
Similar to SQL Server, the transaction log for each database is truncated whenever a log backup completes successfully. Truncation leaves empty space in the log file, which can then be used for new transactions. When the log file cannot be truncated by log backups, the log file grows to accommodate new transactions. If the log file grows to its maximum limit in Azure SQL Database, new write transactions fail.
38+
Similar to SQL Server, the transaction log for each database is truncated whenever a log backup completes successfully. Truncation leaves empty space in the log file, which can then be used for new transactions. When the log file can't be truncated by log backups, the log file grows to accommodate new transactions. If the log file grows to its maximum limit in Azure SQL Database, new write transactions fail.
3939

4040
For information on transaction log sizes, see:
4141

@@ -46,36 +46,36 @@ For information on transaction log sizes, see:
4646

4747
## Prevented transaction log truncation
4848

49-
To discover what is preventing log truncation in a given case, refer to `log_reuse_wait_desc` in `sys.databases`. The log reuse wait informs you to what conditions or causes are preventing the transaction log from being truncated by a regular log backup. For more information, see [sys.databases (Transact-SQL)](/sql/relational-databases/system-catalog-views/sys-databases-transact-sql?view=azuresqldb-current&preserve-view=true).
49+
To discover what's preventing log truncation in a given case, refer to `log_reuse_wait_desc` in `sys.databases`. The log reuse wait informs you to what conditions or causes are preventing the transaction log from being truncated by a regular log backup. For more information, see [sys.databases (Transact-SQL)](/sql/relational-databases/system-catalog-views/sys-databases-transact-sql?view=azuresqldb-current&preserve-view=true).
5050

5151
```sql
5252
SELECT [name], log_reuse_wait_desc FROM sys.databases;
5353
```
5454

55-
For Azure SQL Database, it is recommended to connect to a specific user database, rather than the `master` database, to execute this query.
55+
For Azure SQL Database, it's recommended to connect to a specific user database, rather than the `master` database, to execute this query.
5656

5757
The following values of `log_reuse_wait_desc` in `sys.databases` can indicate the reason why the database's transaction log truncation is being prevented:
5858

5959
| log_reuse_wait_desc | Diagnosis | Response required |
6060
|--|--|--|
61-
| `NOTHING` | Typical state. There is nothing blocking the log from truncating. | No. |
61+
| `NOTHING` | Typical state. There's nothing blocking the log from truncating. | No. |
6262
| `CHECKPOINT` | A checkpoint is needed for log truncation. Rare. | No response required unless sustained. If sustained, file a support request with [Azure Support](https://portal.azure.com/#create/Microsoft.Support). |
6363
| `LOG BACKUP` | A log backup is required. | No response required unless sustained. If sustained, file a support request with [Azure Support](https://portal.azure.com/#create/Microsoft.Support). |
6464
| `ACTIVE BACKUP OR RESTORE` | A database backup is in progress. | No response required unless sustained. If sustained, file a support request with [Azure Support](https://portal.azure.com/#create/Microsoft.Support). |
65-
| `ACTIVE TRANSACTION` | An ongoing transaction is preventing log truncation. | The log file cannot be truncated due to active and/or uncommitted transactions. See next section.|
65+
| `ACTIVE TRANSACTION` | An ongoing transaction is preventing log truncation. | The log file can't be truncated due to active and/or uncommitted transactions. See next section.|
6666
| `REPLICATION` | In Azure SQL Database, this might occur if [change data capture (CDC)](/sql/relational-databases/track-changes/about-change-data-capture-sql-server) is enabled. | Query [sys.dm_cdc_errors](/sql/relational-databases/system-dynamic-management-views/change-data-capture-sys-dm-cdc-errors) and resolve errors. If unresolvable, file a support request with [Azure Support](https://portal.azure.com/#create/Microsoft.Support).|
6767
| `AVAILABILITY_REPLICA` | Synchronization to the secondary replica is in progress. | No response required unless sustained. If sustained, file a support request with [Azure Support](https://portal.azure.com/#create/Microsoft.Support). |
6868

6969
### Log truncation prevented by an active transaction
7070

71-
The most common scenario for a transaction log that cannot accept new transactions is a long-running or blocked transaction.
71+
The most common scenario for a transaction log that can't accept new transactions is a long-running or blocked transaction.
7272

7373
Run this sample query to find uncommitted or active transactions and their properties.
7474

7575
- Returns information about transaction properties, from [sys.dm_tran_active_transactions](/sql/relational-databases/system-dynamic-management-views/sys-dm-tran-session-transactions-transact-sql?view=azuresqldb-current&preserve-view=true).
7676
- Returns session connection information, from [sys.dm_exec_sessions](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-sessions-transact-sql?view=azuresqldb-current&preserve-view=true).
7777
- Returns request information (for active requests), from [sys.dm_exec_requests](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-requests-transact-sql?view=azuresqldb-current&preserve-view=true). This query can also be used to identify sessions being blocked, look for the `request_blocked_by`. For more information, see [Gather blocking information](understand-resolve-blocking.md?view=azuresql-db&preserve-view=true#gather-blocking-information).
78-
- Returns the current request's text or input buffer text, using the [sys.dm_exec_sql_text](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-sql-text-transact-sql?view=azuresqldb-current&preserve-view=true) or [sys.dm_exec_input_buffer](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-input-buffer-transact-sql?view=azuresqldb-current&preserve-view=true) DMVs. If the data returned by the `text` field of `sys.dm_exec_sql_text` is NULL, the request is not active but has an outstanding transaction. In that case, the `event_info` field of `sys.dm_exec_input_buffer` contains the last statement passed to the database engine.
78+
- Returns the current request's text or input buffer text, using the [sys.dm_exec_sql_text](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-sql-text-transact-sql?view=azuresqldb-current&preserve-view=true) or [sys.dm_exec_input_buffer](/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-input-buffer-transact-sql?view=azuresqldb-current&preserve-view=true) DMVs. If the data returned by the `text` field of `sys.dm_exec_sql_text` is NULL, the request isn't active but has an outstanding transaction. In that case, the `event_info` field of `sys.dm_exec_input_buffer` contains the last statement passed to the database engine.
7979

8080
```sql
8181
SELECT [database_name] = db_name(s.database_id)
@@ -140,8 +140,8 @@ To resolve this issue, try the following methods:
140140

141141
1. The issue can occur in any DML operation such as insert, update, or delete. Review the transaction to avoid unnecessary writes. Try to reduce the number of rows that are operated on immediately by implementing batching or splitting into multiple smaller transactions. For more information, see [How to use batching to improve SQL Database application performance](../performance-improve-use-batching.md?view=azuresql-db&preserve-view=true).
142142
1. The issue can occur because of index rebuild operations. To avoid this issue, ensure the following formula is true: (number of rows that are affected in the table) multiplied by (the average size of field that's updated in bytes + 80) < 2 gigabytes (GB). For large tables, consider creating partitions and performing index maintenance only on some partitions of the table. For more information, see [Create Partitioned Tables and Indexes](/sql/relational-databases/partitions/create-partitioned-tables-and-indexes?view=azuresqldb-current&preserve-view=true).
143-
1. If you perform bulk inserts using the `bcp.exe` utility or the `System.Data.SqlClient.SqlBulkCopy` class, try using the `-b batchsize` or `BatchSize` options to limit the number of rows copied to the server in each transaction. For more information, see [bcp Utility](/sql/tools/bcp-utility).
144-
1. If you are rebuilding an index with the `ALTER INDEX` statement, use the `SORT_IN_TEMPDB = ON`, `ONLINE = ON`, and `RESUMABLE=ON` options. With resumable indexes, log truncation is more frequent. For more information, see [ALTER INDEX (Transact-SQL)](/sql/t-sql/statements/alter-index-transact-sql?view=azuresqldb-current&preserve-view=true).
143+
1. If you perform bulk inserts using the `bcp.exe` utility or the `SqlBulkCopy` class (available in both `Microsoft.Data.SqlClient` and `System.Data.SqlClient`), try using the `-b batchsize` or `BatchSize` options to limit the number of rows copied to the server in each transaction. For more information, see [bcp Utility](/sql/tools/bcp-utility).
144+
1. If you're rebuilding an index with the `ALTER INDEX` statement, use the `SORT_IN_TEMPDB = ON`, `ONLINE = ON`, and `RESUMABLE=ON` options. With resumable indexes, log truncation is more frequent. For more information, see [ALTER INDEX (Transact-SQL)](/sql/t-sql/statements/alter-index-transact-sql?view=azuresqldb-current&preserve-view=true).
145145

146146
> [!NOTE]
147147
> For more information on other resource governance errors, see [Resource governance errors](troubleshoot-common-errors-issues.md?view=azuresql-db&preserve-view=true#resource-governance-errors).

0 commit comments

Comments
 (0)