mercredi 26 mars 2014

parse XML Datatype into SQL Table


Vote count:

0




I want to parse a xml Datatype into a SQL Table. This is my XML File: http://ift.tt/1p7TP8A


I wrote this Query but for some reason it pics only the First Element of each string:



SELECT
d.c.value('IPAdd[1]', 'nvarchar(82)') [PLCLANIPAddress],
d.c.value('PName[1]', 'nvarchar(82)') [PartNumber],
b.c.value('IPAdd[1]', 'nvarchar(82)') [PLCAppName],
b.c.value('PName[1]', 'nvarchar(82)') [PLCAppDescription]

FROM @xml.nodes ('AB_Diag_PLCLANTMgr') a ( c )
Outer Apply a.c.nodes ('PLCLAN_IP_PCat') d ( c )
Outer Apply a.c.nodes ('PLCLAn_AppName_Desc') b ( c )


Thanks in advance



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire