dotnet / dotnet/announcements

Announcement: System.Data.SqlClient package is now deprecated

Open
#322 0 comments 0 reactions 0 assignees View on GitHub
Lifecycle PSA Support
Dominant language
No language data
Stars
1.4k
Forks
53
PR merge metrics
No merged PRs in 30d

Description

> This issue is a locked mirror of https://github.com/dotnet/SqlClient/issues/2778. See that issue for discussion.

We [announced Microsoft.Data.SqlClient](https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/) in the first half of 2019 and [shipped the first stable](https://techcommunity.microsoft.com/t5/sql-server-blog/released-general-availability-of-microsoft-data-sqlclient-1-0/ba-p/825859) package later that year. That release [coincided with .NET Core 3.0](https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0/#introducing-the-new-sqlclient). We’ve been developing [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) in the [dotnet/SqlClient](https://github.com/dotnet/SqlClient) repo since that time, over the last five years. It’s now time to start the deprecation process for the [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) package. We plan to take a staged process to deprecation, with the intent to align support changes and associated code transition activities between these libraries to natural migration points between .NET major versions.

All System.Data.SqlClient users are encouraged to transition to Microsoft.Data.SqlClient. We offer improvements and significantly higher support via the Microsoft.Data.SqlClient package.

### Plan

We intend to deprecate the System.Data.SqlClient package in stages.
- **Before .NET 9 GA:**
- Publish a new 5.0.0 package, including the following changes.
- Remove support for .NET 7 and earlier and .NET Framework 4.6.1 and earlier.
- Publish assets for the following target frameworks: .NET 8, .NET Framework 4.6.2, .NET Standard 2.0.
- Add [Obsolete attributes](https://learn.microsoft.com/dotnet/csharp/language-reference/attributes/general#obsolete-attribute) to .NET 8 and .NET Standard 2.0 assets. This will generate new warnings for .NET 8+ and .NET Standard users.
- Continue to offer security servicing, for .NET 8, and .NET Framework 4.6.2+ application users.
- **After .NET 9 GA:**
- No change
- We will not support this package for .NET 9+ application users.
- **After .NET 8 EOL:**
- Remove support for .NET 8 users (the .NET 8 library will be removed).
- Maintain support for .NET Framework 4.6.2+ users.
- Security servicing will be provided via .NET Framework, not the package, at that point.
- We do not expect to update the package again after this point.
- We will not mark the package as deprecated since it will only support .NET Framework users with an implementation provided by .NET Framework.

We will remove support in the package for unsupported .NET and .NET Framework versions at various stages of this deprecation plan. Users affected by those changes are encouraged to move to a supported .NET or .NET Framework version and to adopt the Microsoft.Data.SqlClient package.

We decided to remove support for .NET 6 since it will go EOL shortly after this new package is released, even though .NET 6 will still be supported at the time. Publishing a .NET 8 library significantly simplifies the plan, both in terms of what we will deliver and what we need to explain.

For .NET dates, see [.NET Releases.](https://github.com/dotnet/core/blob/main/releases.md) .NET 9 will [GA in November](https://github.com/dotnet/core/blob/main/releases.md) of this year. .NET 8 will go EOL in November, 2026.

The current package version of [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) is 4.8.6, at the time of writing. These changes will be made with a 5.0.0 version and later.

**Note:** _This deprecation doesn’t apply to the System.Data.SqlClient namespace in .NET Framework._

### Microsoft.Data.SqlClient

Daily downloads of Microsoft.Data.SqlClient on nuget.org are nearing 50% higher than System.Data.SqlClient. We expect the gap in usage between the two libraries will continue to increase. Microsoft.Data.SqlClient is the best library we offer to access SQL Server.

We are committed to providing high-quality, performance-driven, and secure data access technologies. We strongly encourage users to transition to Microsoft.Data.SqlClient. It is actively maintained and supports the latest SQL Server features.

### How to migrate?

Add the NuGet package to your project, then update your references and using statements. Our [porting cheat sheet](https://github.com/dotnet/SqlClient/blob/master/porting-cheat-sheet.md) provides a step-by-step set of changes you may need to make.

1. **Update your project references:** Replace references to System.Data.SqlClient with Microsoft.Data.SqlClient.
2. **Modify your using statements:** Update your using statements in your code files from System.Data.SqlClient to Microsoft.Data.SqlClient.
3. **Test your application:** Thoroughly test your application to ensure that it works as expected after the migration.

We also plan to [support semi-automatic migration](https://github.com/dotnet/upgrade-assistant/issues/1593) via [.NET Upgrade Assistant](https://dotnet.microsoft.com/en-us/platform/upgrade-assistant).

**Support & Feedback:** If you have any questions or need assistance with the migration, please reach out through our [official support channels](https://support.microsoft.com/) or join the discussion on our [GitHub repository](https://github.com/dotnet/SqlClient/issues).

**Resources**
- [Frequently Asked Questions - dotnet/SqlClient Wiki - GitHub](https://github.com/dotnet/SqlClient/wiki/Frequently-Asked-Questions)
- [Introduction to Microsoft.Data.SqlClient namespace](https://learn.microsoft.com/en-us/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace?view=sql-server-ver16)
- [SQL Server and ADO.NET (Microsoft.Data.SqlClient)](https://docs.microsoft.com/en-us/sql/connect/ado-net/sql)
- [Microsoft.Data.SqlClient API Browser](https://docs.microsoft.com/dotnet/api/microsoft.data.sqlclient)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.