Home Forums Programming XML Please recommend best way to read this xml content into a table RE: Please recommend best way to read this xml content into a table

  • MM: Thanks for the /text() tip there.

    photo1: try this to get the speed values

    SELECT t.c.value('(Speed[@Type="Avg"]/text())[1]', 'varchar(20)') AS 'SpeedAvg'

    , t.c.value('(Speed[@Type="Inst"]/text())[1]', 'varchar(20)') AS 'SpeedInst'

    , t.c.value('(Speed[@Type="Max"]/text())[1]', 'varchar(20)') AS 'SpeedMax'

    FROM @xml.nodes('/VehicleInfoMessage/GPSFixes/GPSFix') T(c)