I tried to verify whether my code using FOR XML
clause will run on Azure SQL Database. So I looked to Microsoft online documents (FOR XML (SQL Server))
where I found that it is not supported
While I was looking for a solution I found: Is 'FOR XML' (RAW, AUTO, PATH) supported in SQL Azure which states that it is supported. So I made an experiment
print @@VERSION
select (select 'aa' FOR XML PATH('tag'),TYPE)
with result
Microsoft SQL Azure (RTM) - 12.0.2000.8
Mar 19 2019 04:06:22
Copyright (C) 2019 Microsoft Corporation
----------------------------------------------
<tag>aa</tag>
(1 row affected)
So the question is: Is there an error in documents or do I read it wrong way or is it supported now and will not be in future?
Edit (September 2022)
The page FOR XML (SQL Server) now states that 'FOR XML' is supported in SQL Azure and so the question is no longer relevant.