Share via

Column Data size issue

RAMA KRISHNA MANDALAPU 5 Reputation points
2025-09-03T02:13:57.8066667+00:00

Hi,
I have an "ID" column in the tblAudit table with datatype NUMERIC(18,0).

The table has 45 million records, and the ID column is the clustered primary key.

Generally, this column should occupy less than 1 GB of storage, but on my server, it is occupying 5755 GB for this single column.
Question :

  1. Why it was occipied more storage than expected .
  2. How to fix it now .
SQL Server Database Engine

Answer recommended by moderator

Abdifatah Hassan Roble 80 Reputation points
2025-09-04T12:30:49.3866667+00:00

Hi Rama Krishna,

Reason for Excessive Storage

NUMERIC(18,0) only requires 9 bytes per row. For 45 million rows, it should occupy <1 GB.

If it’s showing 5,755 GB, likely causes include:

  1. Severe fragmentation or page bloat (especially since it’s a clustered PK).
  2. Ghost records / versioning if snapshot isolation is enabled.
  3. Database corruption or incorrect storage reporting.

Steps to Fix

  1. Check fragmentation & table size:

EXEC sp_spaceused 'tblAudit';

  1. Rebuild the clustered index:

ALTER INDEX PK_tblAudit_ID ON tblAudit REBUILD;

Consider setting an appropriate FILLFACTOR if there are many inserts.

  1. Verify database integrity:

DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;

  1. Review the data type:

If ID fits within BIGINT range, consider changing from NUMERIC(18,0) → BIGINT to reduce storage per row.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,086 Reputation points
    2025-09-03T15:12:45.25+00:00

    Because it’s a clustered index, it contains all the table data.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.