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

Why This Error Happens

Error 2360 occurs when SQL Server 2025 parses an XML Schema Definition (XSD) and encounters an element or attribute declaration that specifies both a name and a ref attribute simultaneously, which violates the W3C XML Schema specification. This typically happens when a custom XML Schema Collection is registered with malformed XSD syntax, or when a third-party tool generates XSD files for SSIS packages, XML columns, or SOAP endpoints with conflicting declarations. It can also surface after a failed in-place upgrade from SQL Server 2022 to 2025, where legacy schema collections were not revalidated against the stricter 2025 XML parser.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Schema File

  • Review the full error message for the Location: '%ls' value — this points to the exact XSD file path or XML Schema Collection name causing the conflict.
  • Run the following query to locate schema collections in the affected database:
  SELECT name, schema_namespace, xml_schema_namespace_id 
  FROM sys.xml_schema_collections;
  • Export the suspect schema using SELECT xml_schema_namespace('dbo','SchemaName') to inspect its raw XSD content.

Step 2: Correct the XSD Declaration

  • Open the XSD file in a text editor or Visual Studio 2022/2025 XML editor.
  • Locate the <xs:element> or <xs:attribute> node that has both name="..." and ref="..." set.
  • Per XSD rules, keep only one: use name when defining a new element locally, or use ref when referencing an already-declared global element — remove the redundant attribute.
  • Save the corrected file with UTF-8 encoding (no BOM) to avoid secondary parsing errors.

Step 3: Re-register the XML Schema Collection

  • Drop the broken collection if it partially registered:
  DROP XML SCHEMA COLLECTION dbo.YourSchemaName;
  • Re-create it using the corrected XSD file:
  CREATE XML SCHEMA COLLECTION dbo.YourSchemaName AS N'<corrected XSD content>';
  • If the error originated from an SSIS package or SSDT project, right-click the .dtsx/.xsd reference in Solution Explorer and select Validate XML before redeploying.

Step 4: Clear Cached Metadata (Windows Server 2025 / Windows 11)

  • Restart the SQL Server (MSSQLSERVER) service via services.msc or:
  Restart-Service -Name MSSQLSERVER -Force
  • Clear the SSISDB cache if applicable by running exec [SSISDB].[catalog].[clean_logs] to remove stale schema references tied to failed deployments.

Alternative or Verification Steps

  • Verify the fix by re-running the query/import operation that triggered Error 2360; confirm sys.xml_schema_collections now shows the schema without errors using SELECT * FROM sys.dm_exec_describe_xml_schema_collection(...).
  • If the issue persists, use the XSD Schema Validation Tool (xsd.exe from the Windows SDK) locally to lint the file independently of SQL Server — this isolates whether the error is in the SQL Server parser or the source XSD itself.