Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Reclaim space following column drop Expand / Collapse
Author
Message
Posted Friday, December 13, 2013 6:44 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Yesterday @ 4:18 AM
Points: 450, Visits: 301
Hi all,

I've got a very large table (3M+) records with a decimal column that is too wide - it's defined as a DECIMAL(18,5), but a DECIMAL(9,3) will suffice. This should save me 4 bytes per row, but after an ALTER TABLE the space used is still the same. I know there's DBCC CLEANTABLE command to reclaim space when variable columns are changed, but does anyone how I can reclaim the space after changing the DECIMAL column?

Thanks in advance.



Post #1522667
Posted Friday, December 13, 2013 7:36 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:50 AM
Points: 12,877, Visits: 31,792
you have to rebuild all the indexes on the table, including the clustered index i believe in order to free the space to the database again.



Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1522691
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse