SQL XML Example - LoadFile1.sql

declare

@xmlDoc xml

set

@xmlDoc = (

select

*

from

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

as

a

)

select

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

@xmlDoc.value(

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

@xmlDoc