I have a xml File, which has a strucure like this:
<Material>
<MaterialNumber>7654321</MaterialNumber>
<Carton>
<IDType>qwer</IDType>
<EncodingType>asdf</EncodingType
</Carton>
</Material>
I want to import materialnumber
as well as idtype
...
how can I import when there are two different layers? I only want to switch @Attribute
. Thank you very much!
SET @Attribute = 'Carton/IDType'
SELECT
a.b.value('*[local-name() = sql:variable("@Attribute")][1]','varchar(1000)') AS blub
FROM @myxml.nodes('//Material') a(b)