Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

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)

SQL 2008 : Uncompressed Objects Procedure

By Richard Doering,

Introduction :

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.

Usage :

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).

Output :

The procedure provides >

  1. Lists of tables & indexes without compression
  2. Lists of tables & indexes not using the desired compression (e.g. ROW when you've specified a compression type of PAGE)
  3. TSQL commands to compress the database objects.

Examples :

EXEC dbo.UncompressedObjects
@database = 'MyDatabase'
, @compressiontype = 'ROW'

EXEC dbo.UncompressedObjects
@database = 'Adventureworks'
, @compressiontype = 'PAGE'
, @emailrecipients = 'emailaddress@domain.com'
, @emailprofile = 'Profile Name'

NB :

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.

Richard Doering

http://sqlsolace.blogspot.com

Total article views: 690 | Views in the last 30 days: 3
 
Related Articles
SCRIPT

Script to Compress Tables and Indexes

This script creates scripts to compress all tables and indexes in a database.

SCRIPT

Compress tables

It compresses all the tables/indexes in a database, a specific one or all the objects inside a datab...

BLOG

A Script A Day - Day 9 - Index Compression Estimations

Today's script provides amongst other information Index compression estimates based on existing inde...

ARTICLE

SQL Server 2008 Compression

Testing and analysis of new backup compression and table/index compression features of SQL Server 20...

FORUM

Compression/Decompression of values in Database

Compression/Decompression of values in Database

Tags
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones