FULL TSQL SCRIPT IS HERE: www.dargelis.net/idea/sql-scripts/XML_select.sql
DECLARE @xml_str xml
SET @xml_str='
?shiporder?
?orderid?889923?/orderid?
?orderperson?John Smith?/orderperson?
?shipto?
?name?Alexey?/name?
?address?Champ elysee 1?/address?
?city?Paris?/city?
?country?France?/country?
?/shipto?
?lines?
?item?
?product?Lager format printer?/product?
?note?Special Edition?/note?
?quantity?2?/quantity?
?price?1090?/price?
?/item?
?item?
?product?Big boxes?/product?
?quantity?100?/quantity?
?price?9.90?/price?
?/item?
?item?
?product?iPhone?/product?
?note?model X?/note?
?quantity?2?/quantity?
?price?1234.56?/price?
?/item?
?/lines?
?/shiporder?'
SELECT @xml_str.value('(/shiporder/shipto/city)[1]','varchar(50)') as one,
@xml_str.value('(/shiporder/lines/item/product)[1]','varchar(50)') as two,
@xml_str.value('(/shiporder/lines/item/product)[2]','varchar(50)') as three,
@xml_str.value('(/shiporder/lines/item/product)[3]','varchar(50)') as four,
(select T.c.value('local-name(.)', 'varchar(50)')
FROM @xml_str.nodes('/*') T(c)) as five
Sur cette page du site, vous pouvez voir la vidéo en ligne T-SQL: Extracting values from XML durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Alex D 02 novembre 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,487 fois et il a aimé 7 téléspectateurs. Bon visionnage!