SQL XML Example - LoadFile2.sql

declare

@xmlDoc xml

set

@xmlDoc = (

select

*

from

openrowset (bulk 'c:\temp\doc2.xml', single_clob)

as

a

);

with

xmlnamespaces (default 'http://blogs.msdn.com/federaldev/xmldemo')

select

@xmlDoc.value('(/doc/header/id)[1]','int'),

@xmlDoc.value(

'(/doc/header/year)[1]','char(4)'),

@xmlDoc