gpt4 book ai didi

xml - 使用完整声明将 xml 插入数据库

转载 作者:数据小太阳 更新时间:2023-10-29 02:42:16 27 4
gpt4 key购买 nike

我有一个声明如下的 xml 字符串:

N'<?xml version="1.0" encoding="utf-16"?>
<ParentNode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ChildNodes>
<Node1>106637.5</Node1>
<Node2>4</Node2>
</ChildNodes>
</ParentNode>'

我已成功插入到 MSSQL 数据库,但似乎 sql server 自动删除了 xml 声明(<?xml version="1.0" encoding="utf-16"?>)。

如何强制 sql server 插入带有完整声明的 xml 字符串之上?

最佳答案

How can I force sql server to insert above xml string with full declaration ?

这是不可能的。 Limitations of the xml Data Type

The XML declaration PI in an instance is not preserved when the instance is stored in the database.

关于xml - 使用完整声明将 xml 插入数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7358570/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com