
USE [AdventureWorks]
go

-- Load the new XML schema from a file
DECLARE @x XML
SET @x = (
SELECT * FROM OPENROWSET(
   BULK 'C:\Labs\L08_XML\Starter\XMLDataType\order_v2.xsd',
           SINGLE_BLOB
) AS x
)

-- And use it to create an XML schema collection
-- Allow V1 and V2 orders
-- ALTER the XML SCHEMA COLLECTION here
go

-- XML SCHEMA COLLECTION ALTERED

-- Buy more than one product at a time
-- Include the required order date
INSERT INTO order_form_temp(order_form_xml)
SELECT * FROM OPENROWSET(
   BULK 'C:\Labs\L08_XML\Starter\XMLDataType\order3.xml',
   SINGLE_BLOB) AS x
go