I tried to test this by creating an attribute of type ntext on a
custom entity with a length of 2000 characters. My assumption, based
on what I have read, is that this will consume 16 bytes in SQL Server.
When I open up SQL Server and view the column that relates to the
newly created attribute I note that it is an nvarchar type and is
represented as (nvarchar(max), null). When I put some data into this
field and then run a query in SQL Server to return the datalength, it
returns 2 x length of field, in other words it is behaving just like
an nvarchar data type.
Can somebody explain to me if this is expected and that even though it
is telling me it is using, for example, 4128 bytes (len = 2064) it is
actually only using 16 bytes, as this doesn't appear to be the case.
Thanks
Bob
If you are concerend with the size of the sql data-page with its 8192byte
limit, use the 16 bytes for any var(max)-type. The storage engine will move
any var(max) data out-of-page before any problems would occur.
--
Patrick Verbeeten (MCPD)
Lead Developer
Aviva IT
Extended Entity and Plug-in browser:
http://www.patrickverbeeten.com/maps/CrmTool.aspx
Excellent, thanks for your help Patrick.