How to add attributes to xml nodes in sql server 2005

前端 未结 3 1583
北恋
北恋 2021-01-13 14:41

If i wanted to add an attribute to the root element record, can i do this from the sql side?

SELECT top 1 \'text\' as nodeA
                from test as z
FO         


        
3条回答
  •  孤城傲影
    2021-01-13 15:05

    Your example is not doing what is requested.

    request:

    
       
          
             text
          
       
    
    

    your answer:

    
       
          
             text
          
       
    
    

    I'm doing something similar and using PowerShell to scrub the file before saving it:

    scrub reason 1: https://connect.microsoft.com/SQLServer/feedback/details/265956/suppress-namespace-attributes-in-nested-select-for-xml-statements

    scrub reason 2: THIS

提交回复
热议问题