HiThe following is the code which does not give any results. Will highly appreciate if I get some help. Thanks in advance. //HariExpecting result as follows:897;;825 1 3897;;825 2 50 DECLARE @idoc intDECLARE @doc varchar(8000)SET @doc ='<?xml version="1.0" encoding="UTF-8"?><DespatchAdvice xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2" xmlns:clm5639="urn:un:unece:uncefact:codelist:specification:5639:1988" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:cct="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:clmIANAMIMEMediaType="urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:clm66411="urn:un:unece:uncefact:codelist:specification:66411:2001" xmlns:clm54217="urn:un:unece:uncefact:codelist:specification:54217:2001" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"><cbc:UBLVersionID>2.1</cbc:UBLVersionID><cbc:ID>897;;825</cbc:ID><cbc:UUID>ceda8bec-5bc3-443f-85b3-1d22778ff601</cbc:UUID><cac:DespatchLine><cbc:ID>1</cbc:ID><cbc:DeliveredQuantity>3.000000</cbc:DeliveredQuantity><cac:OrderLineReference><cbc:SalesOrderLineID>10</cbc:SalesOrderLineID></cac:OrderLineReference></cac:DespatchLine><cac:DespatchLine><cbc:ID>2</cbc:ID><cbc:DeliveredQuantity>50.000000</cbc:DeliveredQuantity><cac:OrderLineReference><cbc:SalesOrderLineID>20</cbc:SalesOrderLineID></cac:OrderLineReference></cac:DespatchLine></DespatchAdvice>' EXEC sp_xml_preparedocument @idoc OUTPUT, @doc, '<DespatchAdvice xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2" xmlns:clm5639="urn:un:unece:uncefact:codelist:specification:5639:1988" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:cct="urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:clmIANAMIMEMediaType="urn:un:unece:uncefact:codelist:specification:IANAMIMEMediaType:2003" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:clm66411="urn:un:unece:uncefact:codelist:specification:66411:2001" xmlns:clm54217="urn:un:unece:uncefact:codelist:specification:54217:2001" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2"/>'SELECT * INTO #TempEdge FROM OPENXML (@idoc,'/DespatchAdvice/cac:DespatchLine',2) WITH (picklist_packlist_no varchar(32) '../../cbc:ID', linenumber int 'cbc:ID', itempicked decimal(16,6) 'DeliveredQuantity', status varchar(64), finaldelivery varchar(1) )EXEC sp_xml_removedocument @idocselect * from #TempEdge drop table #TempEdge
↧