Sql-server – Do empty columns take up space in a table

database-designsql-server-2008

I have table that holds from very basic info. Just a title and a few date fields.
There's one field called comments which is varchar(4000)
Most of the time we leave it blank, but some times will enter a large amount of data here.
Is this a really bad design? Or is this just slightly inefficient?

I would assume the creating a separate table for this column would be better.

note: this is sql server 2008

enter image description here

Best Answer

For more predictable performance (and to avoid having high variation of rows per page), I would lean to storing this data in a related table - especially if it is only populated a small percentage of the time, and especially if it is only retrieved in some of the queries. The rows where this value is NULL do contribute to space overhead, but this is minimal. More important will be how one page might only fit two rows and the next page can fit 500 rows - this can really impact statistics and you might be better off splitting this out so it is stored separately and doesn't impact all of your operations on the core table.