I have a MS SQL Server 2008 database on a shared hosting and I need to reduce the used storage space as much as possible. My largest table has the following definition:
CREATE TABLE [stage](
[station_id] [smallint] NOT NULL,
[time_utc] [smalldatetime] NOT NULL,
[stage_mm] [smallint] NOT NULL,
CONSTRAINT [PK_stage] PRIMARY KEY CLUSTERED ([station_id] ASC,[time_utc] ASC)
I tried to find out the average number of bytes per record in my table. According to theory the size should be: 4B (row header) + 2B (smallint) + 4B (smalldatetime) + 2B (smallint) which is 12 bytes.
However, when I ran the command:
dbcc showcontig ('stage') with tableresults
It shows: MinimumRecordSize=15, MaximumRecordSize=15 So according to SQL Server, the bytes per record is 15 and not 12 The number 15 bytes per record seems also correct when I look at the total disk space taken by the table and divide it by number of rows.
What is taking up the 3 extra bytes ???