I try to understand how SQL Server 2008 store xml columns in an attempt to estimate table size in our product.
我尝试了解SQL Server 2008如何存储xml列以尝试估计产品中的表大小。
I'm using DATALENGTH(xml_column)
to run some test and results are disturbing :
我正在使用DATALENGTH(xml_column)来运行一些测试,结果令人不安:
Xml document length | Datalength | Bytes per character
175 | 366 | 2.09
15 | 38 | 2.53
314 | 414 | 1.31
Obviously, the xml column type is not a nvarchar(max)
in disguise, as I've read somewhere.
显然,xml列类型不是伪装的nvarchar(max),正如我在某处读到的那样。
It's probably compacted and stored as binary, but a can't find how anywhere.
它可能被压缩并存储为二进制文件,但无法找到任何地方。
Can someone explain me how is an xml column stored in SQL Server 2008 ?
有人可以解释一下如何在SQL Server 2008中存储xml列吗?
2 个解决方案
#1
7
An XML column is stored in a "compact binary format".
XML列以“紧凑二进制格式”存储。
I doubt that Microsoft will give you any more detail than that.
我怀疑微软会不会给你更多细节。
#2
#1
7
An XML column is stored in a "compact binary format".
XML列以“紧凑二进制格式”存储。
I doubt that Microsoft will give you any more detail than that.
我怀疑微软会不会给你更多细节。