Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By Richard Doering,
First of all, I've already evaluated and am using SQL 2008 Table & Index Compression.
This procedure is to help you to do the same. Obviously if you're reading this you're most likely a DBA and will dutifully evaluate whether compression is appropriate for your environment. Personally I'm very impressed and feel the storage savings far outweigh the additional processor overhead.
UncompressedObjects has 2 required parameters, @database and @compressiontype.
@database is the name of the database you want to compress.@compressiontype is either PAGE or ROW compression.
There are 2 optional parameters @emailrecipients and @emailprofile.If these are both supplied, the output is sent to the email addresses supplied (providing you have an email profile configured).
The procedure provides >
EXEC dbo.UncompressedObjects @database = 'MyDatabase', @compressiontype = 'ROW'
EXEC dbo.UncompressedObjects @database = 'Adventureworks', @compressiontype = 'PAGE', @emailrecipients = 'firstname.lastname@example.org', @emailprofile = 'Profile Name'
I've also supplied stored procedure 'UncompressedServerObjects' which simply executes UncompressedObjects for each user database. I schedule this via SQL Agent so I know if objects are created without compression.
I hope people find this script useful.
This script creates scripts to compress all tables and indexes in a database.
It compresses all the tables/indexes in a database, a specific one or all the objects inside a datab...
Today's script provides amongst other information Index compression estimates based on existing inde...
Testing and analysis of new backup compression and table/index compression features of SQL Server 20...
Compression/Decompression of values in Database