• Eirikur Eiriksson - Wednesday, January 3, 2018 8:54 AM

    drew.allen - Wednesday, January 3, 2018 8:44 AM

    Since you're only looking for ONE row, there is no reason to use the relatively expensive .nodes() function.

    SELECT @XML.value('(/tokens/token/typeid/text())[1]', 'int') AS typeidid,
        @XML.value('(/tokens/token/p1/text())[1]', 'decimal(6,3)') AS p1id

    Drew

    Good point Drew, the nodes() function will parse and then reconstruct the xml, quite costly!
    😎

    Hadn't considered that, in all honestly. Thanks Drew. 🙂

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk