Compress all tables/indexes in database

by drjovka 21. May 2012 11:40
-- tables
EXEC sp_MSForEachTable 'ALTER TABLE ? REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE)'
GO

-- indexes
EXEC sp_MSForEachTable 'ALTER INDEX ALL ON ? REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE )'
GO

Tags:

Data Compression

Add comment




biuquote
Loading



Copyright @SQLautopsy 2007-2010