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

Comments (1)
  1. This is the third in a series of posts.  You can find the previous posts here (1, 2)….

Comments are closed.

Skip to main content