可能是一个没有答复的副本.
SQL Server 2008 – Add XML Declaration to XML Output
SQL Server 2008 – Add XML Declaration to XML Output
请让我知道,如果这是可能的.我读了一些博客
http://forums.asp.net/t/1455808.aspx/1
http://www.devnewsgroups.net/group/microsoft.public.sqlserver.xml/topic60022.aspx
但是我不明白为什么我不能这样做.
你必须手动添加它. SQL Server始终将xml内部存储为ucs-2,因此SQL不可能生成一个utf-8编码头
请参阅MSDN上的“Limitations of the xml Data Type”
The XML declaration PI,for example,
<?xml version='1.0'?>
,is not preserved when storing XML data in an xml data type instance. This is by design. The XML declaration (<?xml ... ?>
) and its attributes (version/encoding/stand-alone) are lost after data is converted to type xml. The XML declaration is treated as a directive to the XML parser. The XML data is stored internally as ucs-2.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。