Skip to content

Latest commit

 

History

History
210 lines (147 loc) · 13.3 KB

File metadata and controls

210 lines (147 loc) · 13.3 KB

Release Notes

Preview Release 7.1.0-preview2 - 2026-07-09

This update brings the following changes since the 7.1.0-preview1 release:

Important — package version alignment: Starting with the 7.0.2 release, the Microsoft.Data.SqlClient driver and its companion packages share a single aligned version. Preview 2 of the 7.1 line continues this alignment; the following packages ship together as 7.1.0-preview2:

  • Microsoft.Data.SqlClient
  • Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider
  • Microsoft.Data.SqlClient.Extensions.Azure
  • Microsoft.Data.SqlClient.Extensions.Abstractions
  • Microsoft.Data.SqlClient.Internal.Logging

(Microsoft.SqlServer.Server continues to version independently and remains at 1.0.0.)

Applications must reference the same versions of Microsoft.Data.SqlClient and its extensions for best compatibility. In particular, applications that reference Microsoft.Data.SqlClient.Extensions.Azure must upgrade it to 7.1.0-preview2 when upgrading Microsoft.Data.SqlClient to 7.1.0-preview2.

Compatibility guarantee: All aligned assemblies ship with FileVersion 7.1.0.x and AssemblyVersion 7.0.0.0. The AssemblyVersion is unchanged from 7.0.2, so upgrading from 7.0.2 to 7.1.0-preview2 does not require any new .NET Framework strong-name binding redirects. See the 7.0.2 release notes for the original AssemblyVersion alignment (the one-time breaking change that raised AssemblyVersion from 1.0.0.0 to 7.0.0.0 for Extensions.Azure, Extensions.Abstractions, and Internal.Logging; AzureKeyVaultProvider was already on 7.x).

Added

SqlConnection.GetSchemaAsync

What Changed:

  • Added asynchronous overloads of SqlConnection.GetSchema that mirror the existing synchronous shapes and honor a supplied CancellationToken. The .NET Framework schema code paths were also unified with the .NET Core implementation. (#3005)

Who Benefits:

  • Applications that enumerate database metadata (databases, tables, columns, procedures, etc.) as part of a request pipeline can now do so without blocking a thread on synchronous I/O.

Impact:

  • New GetSchemaAsync(...) overloads are additive; existing GetSchema(...) calls are unchanged.

SQL Graph Column Aliases in SqlBulkCopy

What Changed:

  • SqlBulkCopy column mappings now accept the SQL Graph pseudo-column aliases $node_id, $edge_id, $from_id, and $to_id as destination column names and transparently map them to the underlying physical columns. (#3677)

Who Benefits:

  • Applications that bulk-load SQL Graph node or edge tables can now map source fields directly to the friendly graph aliases instead of pre-computing the internal physical column names.

Impact:

  • Existing mappings continue to work; if a physical column with the same name as an alias already exists, the physical column keeps priority.

SqlBatchCommand.CommandBehavior Is Now Honored

What Changed:

  • The SqlBatchCommand.CommandBehavior property (which existed since batching was introduced but was previously ignored) is now plumbed through the batch execution path so per-command behaviors are honored inside a SqlBatch. SqlBatch.ExecuteReader also now respects the CommandBehavior value passed to it. (#4125)

Who Benefits:

  • Applications composing heterogeneous batches (for example, mixing SchemaOnly metadata queries with data-returning statements) can now express per-command reader behavior without splitting the batch.

Impact:

  • Batches that previously set SqlBatchCommand.CommandBehavior but relied on it being ignored will now see that value applied. Batches that left it at the default (CommandBehavior.Default) are unaffected.

Configurable Idle Connection Timeout

What Changed:

  • Added a Connection Idle Timeout connection-string keyword and matching SqlConnectionStringBuilder.IdleTimeout property that let the connection pool evict pooled connections whose idle time exceeds the configured value. The default is 300 seconds; setting 0 disables idle expiration, and negative values throw ArgumentException. Enforcement is gated on the new Switch.Microsoft.Data.SqlClient.UseLegacyIdleTimeoutBehavior AppContext switch, which defaults to true to preserve historical pooling behavior; set it to false to enable idle-timeout enforcement. (#4295)

Who Benefits:

  • Applications running against Azure SQL Database and other elastic backends can bound connection idle time to align with server-side session recycling and reduce stale-connection failures.

Impact:

  • Default behavior is unchanged: the new keyword is parsed but not enforced until the legacy switch is turned off. When enabled, idle-timeout enforcement applies to the existing connection pool as well.

Changed

Connection Timeout Now Propagates Through the Pool

What Changed:

  • Replaced raw TimeSpan timeouts with a shared TimeoutTimer across SqlConnection.Open[Async], pool acquisition, and physical connection creation, so the Connect Timeout budget can be deducted as a request waits in the pool. Introduces a dependency on Microsoft.Bcl.TimeProvider. Enforcement is gated on the new Switch.Microsoft.Data.SqlClient.UseOverallConnectTimeoutForPoolWait AppContext switch, which defaults to false to preserve historical behavior; set it to true to have pool waits count against the caller's Connect Timeout budget. (#4270)

Who Benefits:

  • Applications that observe pool contention can opt in via the new switch to have the configured Connect Timeout respected end-to-end instead of the budget effectively restarting when a physical connection is eventually opened.

Impact:

  • Default behavior is unchanged: pool waits do not count against Connect Timeout unless the new switch is enabled. When enabled, Open/OpenAsync under heavy pool contention may surface timeouts sooner than before. Successful opens are unaffected.

Other changes

  • Added the SQL Server 2025 json data type to the DataTypes collection returned by SqlConnection.GetSchema. (#3858)
  • Refactored SqlConnection internal state transitions to use Interlocked.CompareExchange guards, hardening the driver against races surfaced by concurrent open/close/reconnect. (#4267)
  • Removed legacy connection-options inheritance from internal APIs, simplifying TryOpenConnection, TryReplaceConnection, and the pool interfaces. (#4237, #4261, #4235)
  • Refactored ForceNewConnection handling. (#4415)
  • Added Async generic helpers to reduce duplication across sync/async code paths. (#4334)
  • Use hardcoded LCID mappings when decoding strings, avoiding repeated culture lookups. (#4212)
  • Reduced allocations by avoiding lock acquisition on SqlErrorCollection counters when no errors exist, and by avoiding stack-trace materialization for expected null-return paths. (#4157, #4099, #4102)
  • Improved EnclaveDiffieHellmanInfo.Size accuracy. (#4346)
  • SqlVector<float> now serializes and deserializes little-endian multibyte values explicitly for consistent behavior across architectures. (#3861)
  • Updated the bundled .NET 10 SDK to 10.0.300. (#4287)

Fixed

  • Fixed a NullReferenceException in SqlCommand.Cancel() when the active connection has already been torn down. (#4372)
  • Fixed Always Encrypted column master key signature verification incorrectly reusing cached results after a prior verification failure. (#4339)
  • Fixed missing bounds checks on TDS token and feature-extension-acknowledgment data lengths that could allow a spoofing server to trigger unbounded allocations. (#4340)
  • Fixed SqlBulkCopy failing in least-privilege environments where the caller lacks permission to run the previous metadata query path. (#4306)
  • Fixed Always Encrypted reads of CekMdVersion and EkValueCount to align with the TDS specification. (#4240)
  • Fixed LoginWithFailover to validate parser state before continuing, preventing null-reference failures during failover login. (#4140)
  • Fixed the SPN used during login to use the resolved port instead of the instance name when Protocol=None or Protocol=Admin is specified. (#4180)
  • Fixed a race in SqlConnection.TryOpenInner that could surface as InvalidCastException; the same race now returns a deterministic InvalidOperationException. (#4179)
  • Fixed several CancellationTokenSource leaks in SqlDataReader, SqlConnection, SqlCommand reconnect paths, and the sequential-stream helpers. (#4009)
  • Documentation fix for server certificate configuration. (#4408)

Removed

SQL Server 7.0 and 2000 Support

What Changed:

  • Removed dead protocol-level code paths for SQL Server 7.0 and SQL Server 2000, along with the now-orphaned SQL Server 2000 type-system compatibility option. The TypeSystem.SQLServer2000 enum value and the Type System Version=SQL Server 2000 connection-string branch are gone. (#4015)

Who Benefits:

  • The driver no longer carries dead legacy code, and the documented connection-string surface (Latest, SQL Server 2005, SQL Server 2008, SQL Server 2012) now matches the implementation exactly.

Impact:

  • Breaking: A connection string that specifies Type System Version=SQL Server 2000 now throws ArgumentException when the connection is opened, instead of being accepted. Applications currently using this value should switch to a supported value such as Latest. There is no change to which servers the driver will connect to — SQL Server 7.0 and 2000 were already rejected during login version negotiation.

Target Platform Support

  • .NET Framework 4.6.2+ (Windows x86, Windows x64, Windows ARM64)
  • .NET 8.0+ (Windows x86, Windows x64, Windows ARM, Windows ARM64, Linux, macOS)

Dependencies

.NET 9.0

  • Microsoft.Bcl.Cryptography 9.0.13
  • Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview2
  • Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview2
  • Microsoft.Data.SqlClient.SNI.runtime 6.0.2
  • Microsoft.Extensions.Caching.Memory 9.0.13
  • Microsoft.IdentityModel.JsonWebTokens 8.16.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
  • Microsoft.SqlServer.Server 1.0.0
  • System.Configuration.ConfigurationManager 9.0.13
  • System.Security.Cryptography.Pkcs 9.0.13

.NET 8.0

  • Microsoft.Bcl.Cryptography 8.0.0
  • Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview2
  • Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview2
  • Microsoft.Data.SqlClient.SNI.runtime 6.0.2
  • Microsoft.Extensions.Caching.Memory 8.0.1
  • Microsoft.IdentityModel.JsonWebTokens 8.16.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
  • Microsoft.SqlServer.Server 1.0.0
  • System.Configuration.ConfigurationManager 8.0.1
  • System.Security.Cryptography.Pkcs 8.0.1

.NET Standard 2.0

  • Microsoft.Bcl.Cryptography 8.0.0
  • Microsoft.Bcl.TimeProvider 8.0.1
  • Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview2
  • Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview2
  • Microsoft.Data.SqlClient.SNI.runtime 6.0.2
  • Microsoft.Extensions.Caching.Memory 8.0.1
  • Microsoft.IdentityModel.JsonWebTokens 8.16.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
  • Microsoft.SqlServer.Server 1.0.0
  • System.Configuration.ConfigurationManager 8.0.1
  • System.Security.Cryptography.Pkcs 8.0.1
  • System.Text.Json 10.0.3
  • System.Threading.Channels 10.0.3

.NET Framework 4.6.2+

  • Microsoft.Bcl.Cryptography 8.0.0
  • Microsoft.Bcl.TimeProvider 8.0.1
  • Microsoft.Data.SqlClient.Extensions.Abstractions 7.1.0-preview2
  • Microsoft.Data.SqlClient.Internal.Logging 7.1.0-preview2
  • Microsoft.Data.SqlClient.SNI 6.0.2
  • Microsoft.Extensions.Caching.Memory 8.0.1
  • Microsoft.IdentityModel.JsonWebTokens 8.16.0
  • Microsoft.IdentityModel.Protocols.OpenIdConnect 8.16.0
  • System.Buffers 4.6.1
  • System.Data.Common 4.3.0
  • System.Diagnostics.DiagnosticSource 10.0.3
  • System.Memory 4.6.3
  • System.Runtime.InteropServices.RuntimeInformation 4.3.0
  • System.Security.Cryptography.Pkcs 8.0.1
  • System.Text.Json 10.0.3
  • System.Threading.Channels 10.0.3
  • System.ValueTuple 4.6.2