
DROP database xmldb
GO

CREATE database xmldb
GO

USE xmldb
GO

CREATE TABLE xmltest (
  id INT IDENTITY PRIMARY KEY,
  xmlcol XML)
GO

INSERT xmltest values('<somexml/>')
GO

CREATE PROCEDURE insert_xml(@x XML)
AS
INSERT xmltest(xmlcol) VALUES(@x)
GO


CREATE TABLE xmltab (
  id INT IDENTITY PRIMARY KEY,
  xmlcol XML)
GO

-- insert a document
INSERT xmltab VALUES('<doc/>')
-- fragment, multiple root elements
INSERT xmltab VALUES('<doc/><doc/>')
-- fragment, bare text element
INSERT xmltab VALUES('Hello World')
-- even this fragment works
INSERT xmltab VALUES('<doc/>sometext')
