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

Troubleshooting Guide: SQL Server Error 6914 – XML Validation Type Definition Not Found

Why This Error Happens

This error occurs when SQL Server attempts to validate an XML instance against a schema collection (XML Schema Collection), but the specific type definition referenced is missing, unregistered, or was never properly imported into the target XML Schema Collection. This commonly happens when a schema component is dropped, partially migrated, or when the XML data references a namespace/type that doesn’t exist in the currently bound collection. It can also surface after a database restore or migration where schema collections were not fully transferred along with dependent objects.

Step-by-Step Resolution Guide

Step 1: Verify the XML Schema Collection Exists

  • Run the following query to confirm the schema collection is present in the target database:
  • SELECT name, xml_schema_namespace FROM sys.xml_schema_collections WHERE name = 'YourSchemaCollectionName';
  • If no rows return, the collection was never created or was dropped during a migration/restore.

Step 2: Inspect the Schema Collection Contents

  • Extract and review the actual XSD content to confirm the missing type is defined:
  • SELECT xml_schema_namespace.* FROM sys.xml_schema_collections CROSS APPLY (SELECT CAST(xml_schema_namespace AS XML) AS content) xml_schema_namespace WHERE name = 'YourSchemaCollectionName';
  • Confirm the <xs:complexType> or <xs:simpleType> matching the error’s reported type name is actually present in the XSD definition.

Step 3: Re-Import or Repair the Schema Collection

  • If the type is missing, drop and recreate the collection with the corrected XSD file:
  • DROP XML SCHEMA COLLECTION YourSchemaCollectionName;
  • CREATE XML SCHEMA COLLECTION YourSchemaCollectionName AS N'<path or inline XSD content>';
  • Ensure the XSD file used for import is the complete, unmodified version matching the original application schema (check with the vendor or source control for Windows Server 2025 deployment packages).

Step 4: Check for Namespace Mismatches

  • Open the XML instance causing the error and confirm the xmlns declaration matches exactly (case-sensitive) the namespace registered in the schema collection.
  • Correct any mismatched namespace URIs in the application code or XML payload before re-submitting the insert/update operation.

Step 5: Rebuild Dependent Objects

  • If the schema collection is used by typed XML columns, drop and recreate those column bindings after the schema fix:
  • ALTER TABLE YourTable ALTER COLUMN XmlColumn XML (YourSchemaCollectionName);
  • Restart the SQL Server 2025 service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear cached schema validation plans.

Alternative or Verification Steps

  • Re-run the original INSERT/UPDATE statement that triggered Error 6914 and confirm it completes without validation errors.
  • If the issue persists, temporarily remove the XML schema binding (ALTER TABLE ... ALTER COLUMN XmlColumn XML;) to isolate whether the problem is schema-related or data-related, then re-apply the typed binding once the correct XSD is confirmed.