What is the cost in bytes for the overhead of a sql_variant column in SQL Server?

Posted by Elan on Stack Overflow See other posts from Stack Overflow or by Elan
Published on 2010-06-03T19:12:39Z Indexed on 2010/06/06 13:52 UTC
Read the original article Hit count: 249

I have a table, which contains many columns of float data type with 15 digit precision. Each column consumes 8 bytes of storage. Most of the time the data does not require this amount of precision and could be stored as a real data type. In many cases the value can be 0, in which case I could get away with storing a single byte.

My goal here is to optimize space storage requirements, which is an issue I am facing working with a SQL Express 4GB database size limit.

If byte, real and float data types are stored in a sql_variant column there is obviously some overhead involved in storing these values. What is the cost of this overhead?

I would then need to evaluate whether I would actually end up in significant space savings (or not) switching to using sql_variant column data types.

Thanks, Elan

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about sql-server-2005