A Few More Useful SQL Server 2008 Specific Queries

Here are several more SQL Server 2008 specific queries that can help determine if you are using certain Enterprise Edition only features, which tables and indexes are using data compression, whether you are using any deprecated features, and look at your results with native backup compression. All of these will only work on SQL Server 2008.

-- Determine if you are using certain Enterprise Only features in SQL Server 2008
    SELECT feature_name, feature_id 
    FROM sys.dm_db_persisted_sku_features
-- Determine which tables and indexes are using data compression
    SELECT OBJECT_NAME([object_id]) AS [TableName], index_id, [rows], 
                       data_compression, data_compression_desc
    FROM sys.partitions
    WHERE data_compression > 0

-- Look for deprecated features in SQL Server 2008 
    SELECT object_name, instance_name, cntr_value 
    FROM sys.dm_os_performance_counters 
    WHERE object_name = 'SQLServer:Deprecated Features' 
    -- (Default instance) Alter this for named instances 

-- Look at recent compressed full backups
    SELECT TOP (5) bs.server_name, bs.database_name AS 'Database Name', 
    CONVERT (BIGINT, bs.backup_size / 1048576 ) AS 'Uncompressed Backup Size (MB)',
    CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS 'Compressed Backup Size (MB)',
    CONVERT (NUMERIC (20,2), (CONVERT (FLOAT, bs.backup_size) /
    CONVERT (FLOAT, bs.compressed_backup_size))) AS 'Compression Ratio', 
    DATEDIFF (SECOND, bs.backup_start_date, bs.backup_finish_date) AS 'Backup Elapsed Time (sec)',
    bs.backup_finish_date AS 'Backup Finish Date'
    FROM msdb.dbo.backupset AS bs 
    WHERE DATEDIFF (SECOND, bs.backup_start_date, bs.backup_finish_date) > 0 
    AND bs.backup_size > 0
    AND bs.type = 'D' -- Change to L if you want Log backups
    ORDER BY bs.backup_finish_date DESC

Technorati Tags:

This entry was posted in SQL Server 2008. Bookmark the permalink.

26 Responses to A Few More Useful SQL Server 2008 Specific Queries

  1. Unknown says:

    <p><a href="http://www.ghdsmk4.com/"><strong>Ghd mk4 straighteners</strong></a> quickly became the essential hair product for anyone with even the slightest frizz in their hair!The range of ghd stylers is ever expanding and improving;The latest limited edition<strong> <a href="http://www.ghdsmk4.com/">GHD Styler</a></strong> to be released is the GHD Precious a€“ a fantastic metallic silver and black styler which is available now in a fabulous GHD Gift Set. This new Pink Set comes in a sizzling new baby pink. The 2009 <a href="http://www.ghdsmk4.com/"><strong>mk4 ghd pink</strong></a> comes with a really lovely looking heat proof pouch. Use the price guide below to find the best online deals for the ghd Pretty in pink hair straighteners.</p>

  2. Unknown says:

    <strong><a href="http://www.lacosteshoesstore.com/">Mens lacoste shoes</a> </strong> are more and more popular with people now.Laocste Swerve Shoes is welcome by youngsters in modern design, it is the latest in the United States,with the cow leather shoes are made of leather,<strong><a href="http://www.lacosteshoesstore.com/">lacoste canada</a></strong><a href="http://www.lacosteshoesstore.com/"></a&gt; also has a good looking.There are string of Lacoste shoes obtainable for equally man and women, where one would exist able to locate his right couple.In addition,the shoes would provide protection of user\’s foot especially while playing sport.<a href="http://www.lacosteshoesstore.com/"><strong>Lacoste shoes canada</strong></a> is a new style.It is made with leather.The Mens Lacoste Shoes are durable and fashionable.

  3. Unknown says:

    <p>we all known ugg boots have many styles .ie,ugg boots classic short.the chocolate ugg boots and many different color ugg boots .Just as with the <strong><a href="http://www.uggyan.com/ugg-classic-tall-c-3.html">Ugg Classic tall</a></strong> the new calf high boot that this footwear company have introduced the <strong>bailey botton </strong>offers the same level of comfort.more important is so cheaper and resonable in price..and the <strong><a href="http://www.uggyan.com/ugg-classic-short-c-1.html">ugg boots classic</a></strong> have unique style and very comfortable .according to it color and style .i think its which enables everyone to share clothing and accessories. at the same time <strong><a href="http://www.uggyan.com/ugg-classic-tall-chocolate-boots-5815-p-1169.html">The chocolate ugg boots </a></strong>is made with 100% premium twin-faced sheepskin that wicks moisture away from your feet.its very suit for us .</p>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s