SQL XML Column - Cross Apply to Produce Multiple Rows based on XML 1 to many
问题 I've been studying this post, but I'm still not understanding the "cross apply" with XML data. Also this post. I have an Xml column that contains a passenger, and the multiple flights and flight-legs on his ticket. This is what I have working after much fiddling: Select xmlDoc.value('(//Passenger[1]/text())[1]', 'varchar(100)') as Passenger, XmlData2.xmlDoc2.query('//FlightLeg') as xmlDoc2b FROM xmlData as t CROSS APPLY t.xmlDoc.nodes('//FlightLeg') AS XmlData2(xmlDoc2) where xmlSchema =