By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,567 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,567 IT Pros & Developers. It's quick & easy.

Why does numeric data type use storage inefficiently?

P: n/a
I have found several sources stating that the numeric data type in SQL
Server (without vardecimal options set) stores numbers of precision
10-19 in 9 bytes. Since 19 * ln(10) / ln(2) ~= 63.11 =65 bits with
sign =9 bytes, I understand 9 bytes at this end of range. However,
10 * ln(10) / ln(2) ~= 33.22 =35 bits with sign =5 bytes. Why
does SQL Server use the 'extra' 4 bytes? Is there an alignment
requirement? If this is the reason, why not break storage
requirements at the base-10 precisions that require 4 bytes and 8
bytes, to be synchronized with 16-, 32-, 64-bit registers?

Just curious...
Thanks in advance,
Feb 6 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.