--- title: "Non-Deterministic Content Models | Microsoft Docs" description: View an example of using an XML schema with a non-deterministic content model. ms.custom: "" ms.date: "03/14/2017" ms.prod: sql ms.prod_service: "database-engine" ms.reviewer: "" ms.technology: xml ms.topic: conceptual helpviewer_keywords: - "non-deterministic content models" - "content models [XML in SQL Server]" ms.assetid: 9d4513e7-dd19-4491-b7c7-28bc7c2f8589 author: MightyPen ms.author: genemi --- # Non-Deterministic Content Models [!INCLUDE[appliesto-ss-asdb-xxxx-xxx-md](../../includes/appliesto-ss-asdb-xxxx-xxx-md.md)] Before [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)] Service Pack 1 (SP1), [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] rejected XML schemas that had non-deterministic content models. Beginning with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)] SP1, however, non-deterministic content models are accepted if the occurrence constraints are 0,1, or unbounded. ## Example: Non-deterministic content model rejected The following example attempts to create an XML schema with a non-deterministic content model. The code fails because it is not clear whether the `` element should have a sequence of two `` elements or if the `` element should have two sequences, each with an `` element. ``` CREATE XML SCHEMA COLLECTION MyCollection AS ' ' GO ``` The schema can be fixed by moving the occurrence constraint to a unique location. For example, the constraint can be moved to the containing sequence particle: ``` ``` Or the constraint can be moved to the contained element: ``` ``` ## Example: Non-deterministic content model accepted The following schema would be rejected in versions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] before [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)] SP1. ``` CREATE XML SCHEMA COLLECTION MyCollection AS ' ' GO ``` ## See Also [Requirements and Limitations for XML Schema Collections on the Server](../../relational-databases/xml/requirements-and-limitations-for-xml-schema-collections-on-the-server.md)