SQL Azure是否支持"FOR XML" [英] Is or is not 'FOR XML' supported in SQL Azure

查看:48
本文介绍了SQL Azure是否支持"FOR XML"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图验证使用 FOR XML 子句的代码是否可以在 Azure SQL数据库上运行.所以我查看了Microsoft在线文档(

在寻找解决方案时,我发现:在SQL Azure中是否支持"FOR XML"(RAW,AUTO,PATH),表明它受支持.所以我做了一个实验

 打印@@ VERSION选择(选择"aa" FOR XML PATH('tag'),TYPE) 

有结果

  Microsoft SQL Azure(RTM)-12.0.2000.82019年3月19日04:06:22版权所有(C)2019 Microsoft Corporation----------------------------------------------< tag> aa</tag>(受影响的1行) 

所以问题是:文档中是否有错误,或者我阅读的方式有误吗?现在是否受支持,将来也不会支持?

解决方案

我总是信任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?

解决方案

I'd always trust the language reference over the fluffier "how to do things" documentation. The latter seem to fall out of date more regularly and not be revisited in a timely fashion.

On the FOR Clause page (linked above) it says it is supported in Azure SQL Database.

APPLIES TO: ✓ SQL Server (starting with 2008) ✓ Azure SQL Database ✗ Azure SQL Data Warehouse ✗ Parallel Data Warehouse

There are no mentions within the page of any Azure specific limitations either.

这篇关于SQL Azure是否支持"FOR XML"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆