procを作成するときに役立つ可能性のあるいくつかの同様の方法を次に示します。
-- Declare some xml
declare @xml xml = '<clientesxml xmlns="http://www.w3.org/2005/Atom">
<final>
<idsku>191</idsku>
<entregado>159</entregado>
</final>
</clientesxml>'
-- Shred the xml
;with xmlnamespaces (default 'http://www.w3.org/2005/Atom')
select x.Record.value('idsku[1]', 'int') as idsku
, x.Record.value('entregado[1]', 'int') as entregado
from @xml.nodes('//clientesxml/final') as x (Record)
-- Shred and insert the xml into a new temp table
;with xmlnamespaces (default 'http://www.w3.org/2005/Atom')
select x.Record.value('idsku[1]', 'int') as idsku
, x.Record.value('entregado[1]', 'int') as entregado
into #tempTable
from @xml.nodes('//clientesxml/final') as x (Record)
-- Shred and insert the xml into an existing temp table
;with xmlnamespaces (default 'http://www.w3.org/2005/Atom')
insert into #tempTable (idsku, entregado)
select x.Record.value('idsku[1]', 'int') as idsku
, x.Record.value('entregado[1]', 'int') as entregado
from @xml.nodes('//clientesxml/final') as x (Record)