How to fix Error 2003 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 2003 — “Procedures with a Group Number Cannot Have Parameters of XML”

Why This Error Happens

This error occurs because SQL Server’s legacy “numbered stored procedures” feature (procedures created with a semicolon suffix, such as ProcName;1) does not support the XML data type for any input or output parameters. The SQL Server 2025 parser explicitly blocks compilation when it detects an XML parameter bound to a grouped procedure, since grouped procedures share a single execution plan cache entry that cannot serialize XML schema collections correctly. This is a design limitation carried forward from SQL Server’s Database Engine, not a corruption or permissions issue — it is purely a syntax/feature incompatibility.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Procedure and Parameter

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run the following query to locate numbered procedures in your database:
  SELECT name, object_id FROM sys.objects WHERE name LIKE '%;%';
  • Confirm which parameter is typed as XML using sys.parameters joined to sys.types.

Step 2: Remove the Group Number Suffix

  • Script out the existing procedure definition (right-click → Script Stored Procedure As → ALTER To).
  • Rename the procedure to remove the semicolon and group number (e.g., change dbo.usp_GetData;1 to dbo.usp_GetData).
  • Drop the old numbered procedure group entirely using:
  DROP PROCEDURE dbo.usp_GetData;

Step 3: Recreate as a Standard Standalone Procedure

  • Use CREATE PROCEDURE (not CREATE PROCEDURE ... ;n) with the XML parameter intact:
  CREATE PROCEDURE dbo.usp_GetData
      @XmlInput XML
  AS
  BEGIN
      SET NOCOUNT ON;
      -- procedure logic here
  END;
  • Update any client connection strings or application code (ADO.NET, ODBC, or .NET 9 Data Provider) that explicitly called the procedure using the ;1 or ;2 group syntax.

Step 4: Update Application Call References

  • Search your application codebase (C#, PowerShell 7, or SSIS packages) for hardcoded calls like EXEC usp_GetData;1.
  • Replace these calls with the plain procedure name EXEC usp_GetData.
  • Redeploy the application or recompile SSIS packages referencing the old group-numbered procedure.

Alternative or Verification Steps

  • Verify the fix by executing EXEC dbo.usp_GetData @XmlInput = '<root/>'; directly in SSMS — it should compile and run without Error 2003.
  • If multiple numbered procedures existed for overload-like behavior, consider consolidating logic into a single procedure with optional parameters (= NULL defaults) instead of relying on deprecated procedure groups.