Retrieving XML element name using t-SQL

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

If I have:


  
    john
    something or other
  
  

        
2条回答
  •  抹茶落季
    2021-02-07 05:37

    DECLARE @xml as xml
    SET @xml = '
    LINE1
    ' SELECT Nodes.Name.query('local-name(.)') FROM @xml.nodes('//*') As Nodes(Name)

    This will give the list of all elements

提交回复
热议问题