Retrieving XML element name using t-SQL

前端 未结 2 456
梦毁少年i
梦毁少年i 2021-02-07 04:39

If I have:


  
    john
    something or other
  
  

        
2条回答
  •  隐瞒了意图╮
    2021-02-07 05:22

    Actually, sorry, the best I've got is:

    select distinct r.value('fn:local-name(.)', 'nvarchar(50)') as t
    FROM
        @xml.nodes('//quotes/*/*') AS records(r)
    

    Guess I answered my own question...

提交回复
热议问题