I am trying to understand how SQL Server 2008 stores xml columns in order to estimate the size of the table in our product.
I use DATALENGTH(xml_column) to run some test, and the results violate:
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 hidden nvarchar(max) , as I read somewhere.
It is probably compressed and stored as a binary, but cannot find it anywhere.
Can someone explain to me how the xml column is stored in SQL Server 2008?
xml sql-server sql-server-2008
Nicolas repiquet
source share