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.
精彩评论