Union in SQL while creating XML file

前端 未结 2 1778
清歌不尽
清歌不尽 2021-01-20 20:36

I got some problem with my SQL query which create a XML file. I want to do UNION it this query but it doesn\'t work.

(SELECT 1 AS \"ns0:kindOfIt         


        
2条回答
  •  别那么骄傲
    2021-01-20 21:01

    Using UNION will remove duplicate values for the result so SQL Server has to compare the XML from the first part with the second part and decide if they are equal and that is not implemented for XML.

    You probably don't want the duplicate check so change to UNION ALL instead and it will work fine for XML data as well.

提交回复
热议问题