Skip to content

remove sqlserver 7 and 2000 support#4015

Open
SimonCropp wants to merge 3 commits intodotnet:mainfrom
SimonCropp:remove-sqlserver-7-and-2000-support
Open

remove sqlserver 7 and 2000 support#4015
SimonCropp wants to merge 3 commits intodotnet:mainfrom
SimonCropp:remove-sqlserver-7-and-2000-support

Conversation

@SimonCropp
Copy link
Contributor

SQL Server 2000's mainstream support ended on April 8, 2008, and extended support ended on April 9, 2013. So it's been fully unsupported for over 12 years now.

@SimonCropp SimonCropp requested a review from a team as a code owner March 6, 2026 13:54
Copilot AI review requested due to automatic review settings March 6, 2026 13:54
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to remove legacy SQL Server 7.0 / 2000 compatibility paths (and related “Type System Version” handling) from SqlClient and its test TDS tooling.

Changes:

  • Removed SQL Server 7.0 / 2000 mappings from the test TDS version helper and tightened supported TDS range to 2005–2012.
  • Removed TypeSystemVersion=SQL Server 2000 parsing support and deleted SQL Server 2000-specific branches in SqlDataReader.
  • Cleaned up several legacy-version comments across core TDS/transaction code paths.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDSVersion.cs Removes SQL7/2000 version constants and mapping; tightens supported TDS range.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs Updates legacy-version comments in TDS parsing logic.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsEnums.cs Removes 2000-era versioning comment lines; updates datatype “version introduced” comment.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlParameter.cs Simplifies legacy server notes around parameter size/type elevation.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs Removes SQL7/2000-specific commentary from zombie handling explanation.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs Removes SQL Server 2000-specific type-system behavior and helper method.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionString.cs Drops SQL Server 2000 from TypeSystemVersion recognized values.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs Updates transaction enlistment comments to remove SQL7/2000 references.
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDSVersion.cs:53

  • GetTDSVersion now throws NotSupportedException for server build majors other than 9/10/11. The simulated TDS server is still used in unit tests with ServerVersion majors 7 and 8 (e.g., tests/UnitTests/SimulatedServerTests/ConnectionTests.cs), so this will throw during server login handling and likely break those tests (and the ability to simulate legacy servers). Consider keeping mappings for 7.0/2000 in the test server, or update/remove the tests and any callers that still pass 7/8 versions.
            else
            {
                // Not supported TDS version
                throw new NotSupportedException("Specified build version is not supported");
            }

public static bool IsSupported(Version tdsVersion)
{
return tdsVersion >= SqlServer7_0 && tdsVersion <= SqlServer2012;
return tdsVersion >= SqlServer2005 && tdsVersion <= SqlServer2012;
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsSupported now requires tdsVersion >= SqlServer2005. For the simulated TDS server, this changes behavior when emulating SQL 7.0/2000: after resolving client/server versions, CheckTDSVersion will reject these versions and return an 'Unsupported TDS client version' error, instead of continuing far enough for the client to perform its own legacy-server rejection logic. If the intent is only to drop client support (not break simulation), keep legacy versions supported in the test server; otherwise, update/remove the tests and any code paths that rely on simulating these legacy versions.

Suggested change
return tdsVersion >= SqlServer2005 && tdsVersion <= SqlServer2012;
return tdsVersion <= SqlServer2012;

Copilot uses AI. Check for mistakes.
Comment on lines +445 to 448
// The following datatypes are specific to 2005 (version 9) or later
public const int SQLINT8 = 0x7f;
public const int SQLVARIANT = 0x62;

// The following datatypes are specific to 2005 (version 9) or later
public const int SQLXMLTYPE = 0xf1;
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above SQLINT8/SQLVARIANT now says these datatypes are 'specific to 2005 (version 9) or later', but the file also treats some 7.0-era semantics separately (e.g., SQL70_DEFAULT_NUMERIC_PRECISION) and historically these tokens predate 2005. If the intent is to document when each token was introduced, consider splitting this into accurate groups (e.g., SQL 2000+/TDS 7.1+ vs SQL 2005+/TDS 7.2+), so future protocol work isn’t misled about type availability/version gates.

Copilot uses AI. Check for mistakes.
@paulmedynski paulmedynski added the Code Health 💊 Issues/PRs that are targeted to source code quality improvements. label Mar 9, 2026
@paulmedynski paulmedynski modified the milestones: 7.0.1, 7.1.0-preview1 Mar 9, 2026
@benrr101 benrr101 moved this from To triage to In review in SqlClient Board Mar 17, 2026
…arser.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 00:45
…arameter.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS/TDSVersion.cs:53

  • GetTDSVersion no longer handles server build versions with major 7 or 8. The simulated TDS server (GenericTdsServer.OnLogin7Request) calls TDSVersion.GetTDSVersion(Arguments.ServerVersion) during login, so starting a test server with ServerVersion = new Version(7, …) or new Version(8, …) will now result in an unhandled NotSupportedException instead of the server returning a clean “unsupported TDS version” response. This is likely to break existing simulated-server unit tests that validate the client rejects SQL Server 7.0/2000. Consider either keeping the 7.0/2000 mapping here for negative-testing purposes, or catching NotSupportedException at the call site and treating it as an unsupported version via CheckTDSVersion.
        public static Version GetTDSVersion(Version buildVersion)
        {
            // Check build version Major part
            if (buildVersion.Major == 11)
            {
                return SqlServer2012;
            }
            else if (buildVersion.Major == 10)
            {
                return SqlServer2008;
            }
            else if (buildVersion.Major == 9)
            {
                return SqlServer2005;
            }
            else
            {
                // Not supported TDS version
                throw new NotSupportedException("Specified build version is not supported");
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Health 💊 Issues/PRs that are targeted to source code quality improvements.

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

4 participants