According to BOL for SQL Server 2008 R2 the data type decimal requires the following storage bytes:
Precision Storage bytes 1 - 9 => 5 10-19 => 9 20-28 => 13 29-38 => 17
However, when I do a datalength() on a column that is formatted decimal(19,5) and has the value of 10999.99999 I get back 5 bytes ? Which is according to my understanding a precision of 10 and not of 9 and should result in 9 bytes.
this results in two questions:
is the size of the table with this column not depending on the column definition, instead the true values within the column define the table size ?
why is the information in BOL not matching with what datalength() returns ?