
USE [AdventureWorks]
go

-- Insert an Invoice
INSERT INTO invoice_docs(invoice)
SELECT * FROM OPENROWSET(
   BULK 'C:\SQLskills\Session2\XMLDataType\invoice1.xml',
   SINGLE_BLOB) AS x
go

-- FIRST DOCUMENT LOADED

SELECT * FROM invoice_docs

-- SELECTED ROW CONTAINING DOCUMENT

-- Attempt to buy more than one product at a time
-- Fails
INSERT INTO invoice_docs(invoice)
SELECT * FROM OPENROWSET(
   BULK 'C:\SQLskills\Session2\XMLDataType\invoice2.xml',
   SINGLE_BLOB) AS x
go

