The code is useful for machine installations of Data Pump SQL projects which periodically clear the [dbo].[PartData] table. Before using this, make sure you first check the database as described here. Change the ‘ASI2353’ to the name of your database.
/* Shrink database, leave file size; just pack inside the file Initial file sizes: DB: 2048MB; Log:256MB */ DBCC ShrinkDatabase ('ASI2353', NOTRUNCATE); -- /* Defrag Indexes */ DBCC IndexDefrag ('ASI2353', 'PartData', 'pk_Part'); -- /* Reclaim space from dropped chars, varchars text.. */ DBCC CleanTable ('ASI2353', 'PartData');