I have a column in a SQL server database that stores numeric values. The issue is that sometimes the number is Billions, sometimes it’s 1.355 E -16. I would set the numeric to be something huge like numeric(35,20) but I assumed that will make them all take up that much space in the database, and that seems like such a waste. Is there a way to do this efficiently, like how we use varchar when sometimes having short strings and other times having long strings?
Share
What version and edition of SQL Server? SQL Server 2005 SP2 introduced a
vardecimalformat which is already deprecated in favour of using row and page compression.Both
vardecimaland compression require Enterprise Edition engine.