开发者

Insert xml to database with full declaration

I have a xml string with declaration such:

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>'

I had successfully insert to MSSQL database, but it seems sql server automatic trims off the xml declaration (<?xml version="1.0" enco开发者_Python百科ding="utf-16"?>).

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


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

It is not possible. Limitations of the xml Data Type

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜