Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

When is storage space allocated?

$
0
0
I'm using SQL Server 2012 with all the latest updates. For a DB I'm using, I altered an existing table with a lot of data in it to add an addition column, type INT, with a default value of -1. That made the storage requirement for the DB on the disk a bit larger, but not much. I then UPDATEd the values in the new column from -1 to other numbers ranging from 0 to over 500,000, and this added several 10s of GB of storage requied for the DB on the disk. I'm baffled by this--wouldn't the full space for an INT column be allocated on the disk when the column is added to the table and not when the value of the data is changed?

Viewing all articles
Browse latest Browse all 15264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>