Skip to content

Instantly share code, notes, and snippets.

@FilipDeVos
Created May 13, 2011 08:27
Show Gist options
  • Save FilipDeVos/970208 to your computer and use it in GitHub Desktop.
Save FilipDeVos/970208 to your computer and use it in GitHub Desktop.
FOR XML RAW Schema Collection
IF EXISTS(SELECT * FROM sys.schemas WHERE name ='xml_raw_schema')
DROP XML SCHEMA COLLECTION dbo.xml_raw_schema
GO
CREATE XML SCHEMA COLLECTION xml_raw_schema AS
N'<?xml version="1.0"?>
<xsd:schema xmlns:targetNamespace="http://schemas.mycompany.com/myproduct"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:element name="table">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="row" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:anyAttribute processContents="skip" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment