extract data from peppol xml file

Aug 4 2023 3:44 PM

i do this to cretae xmxl data from xml file

CREATE TABLE XMLwithOpenXML(Id INT IDENTITY PRIMARY KEY,XMLData XML,LoadedDateTime DATETIME)

INSERT INTO XMLwithOpenXML(XMLData, LoadedDateTime)
SELECT CONVERT(XML, BulkColumn) AS BulkColumn, GETDATE() 
FROM OPENROWSET(BULK 'e:\lgs_MBA\Eff\source\21004360.xml', SINGLE_BLOB) AS x;
SELECT * FROM XMLwithOpenXML

SELECT xmldata.value('(/Invoice/cbc:CustomizationID()', 'VARCHAR(50)') --,        @Xml.value('(/value2/text())[1]', 'INT'),
from XMLwithOpenXML

the data is well in the table and i need to extract 

each field from a simple xquery

 


Answers (1)