Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: XML SQL Query

    mister.magoo (5/26/2014)


    This should do it...

    SELECT

    pref3.value('(../TEAMID/text())[1]','varchar(50)') as TEAM_ID,

    pref3.value('(PLAYERID/text())[1]', 'varchar(50)') as PLAYER_ID,

    pref3.value('(NAME/text())[1]', 'varchar(50)') as PLAYERNAME

    FROM

    XMLwithOpenXML CROSS APPLY

    XMLData.nodes('/GAME/TEAM/PLAYER') AS TEST3(pref3)

    BRILLIANT, thanks for your help.

Viewing post 1 (of 1 total)