The new Microsoft.Data.SqlClient explained

Why did Microsoft move SqlClient to new binaries into NuGet package Microsoft.Data.SqlClient. Should I swap? Future releases? Namespaces?

The "Microsoft.Data.SqlClient" or "Microsoft SqlClient Data Provider for SQL Server" was released on 27 August 2019.
The new namespace "Microsoft.Data.SqlClient" is a swap out for the existing "System.Data.SqlClient" namespace.
The namespace change is needed because the new Data Provider resides in a NuGet package and would clash with the "System.Data.SqlClient" which resides in the .NET Framework at a system level.

The new Microsoft.Data.SqlClient supports
.NET Framework 4.6 +
.NET Core 2.1 +
.NET Standard 2.0 +


The traditional System.Data.SqlClient resides inside .NET framework and there is a separate version for .NET core too. To be able to more quickly release new features for SqlClient it is now distributed in a separate NuGet package instead, this is done in the new Microsoft.Data.SqlClient namespace. This way it is disconnected from the .NET Framework release cycles and can be released more indepently as SQL Server releases new features.

So the new package Microsoft.Data.SqlClient is a swap out for the traditional System.Data.Client part of .NET and .NET Core. Code-wise it should be enough just to change the using / imports statements to the new namespaces as the APIs remain the same.

Should I use it or should I stick to the old one?

Microsoft will favor development of new features in this new NuGet package from now on. For instance the Microsoft SQL Server EF Core Database Provider package, from 3.0, uses the new Microsoft.Data.SqlClient package. So looking forward it is the right thing to start using Microsoft.Data.SqlClient instead of System.Data.SqlClient that will be maintained but will not receive feature updates.

Development of .NET Framework (opposed to .NET Core) systems will also benefit as it will now start to ship the used version together with your binaries and are not relying on target systems setup, i.e. installed .NET Framework version (which provides the System.Data.SqlClient).


Please note that there are different binaries depending on your target and that feature availability differs.

Always Encrypted is available in System.Data.SqlClient for .NET but NOT in .NET Core.
Always Encrypted is available in Microsoft.Data.SqlClient for .NET and ALSO in .NET Core.

SQL Server 2019 features Data Classification and UTF8 is supported by the new Microsoft.Data.SqlClient but not in the old System.Data.SqlClient.

Microsoft.Data.SqlClient is the flagship data access driver for SQL Server and will be the only place Microsoft will be implementing new features going forward.

Namespace changes

Swapping out means changing namespaces.

Previous Is now
System.Data.SqlClient Microsoft.Data.SqlClient
Microsoft.SqlServer.Server Microsoft.Data.SqlClient.Server
System.Data.SqlTypes Microsoft.Data.SqlTypes
System.Data.Sql Microsoft.Data.Sql
System.Data Microsoft.Data