<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: My Top 5 SQL Server Indexing Best Practices</title>
	<atom:link href="http://thesqlagentman.com/2009/04/my-top-5-sql-server-indexing-best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesqlagentman.com/2009/04/my-top-5-sql-server-indexing-best-practices/</link>
	<description>Technically Speaking with Tim Ford</description>
	<lastBuildDate>Tue, 17 Apr 2012 18:53:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Duncan Fairweather</title>
		<link>http://thesqlagentman.com/2009/04/my-top-5-sql-server-indexing-best-practices/comment-page-1/#comment-8667</link>
		<dc:creator>Duncan Fairweather</dc:creator>
		<pubDate>Wed, 01 Sep 2010 17:30:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.ford-it.com/sqlagentman/?p=206#comment-8667</guid>
		<description>USE [XXXXXXXXX]
GO
SELECT 
   SI.[name] AS index_name, 
   OBJECT_SCHEMA_NAME(SDDIPS.[object_id]) + &#039;.&#039; + OBJECT_NAME(SDDIPS.[object_id]) AS [object_name], 
   SDDIPS.[index_type_desc], SDDIPS.[avg_fragmentation_in_percent] 
FROM sys.[dm_db_index_physical_stats](DB_ID(), NULL, NULL, NULL, &#039;Detailed&#039;) SDDIPS
   INNER JOIN sys.[indexes] SI ON SDDIPS.[object_id] = SI.[object_id]
       AND SDDIPS.[index_id] = SI.[index_id]
WHERE SDDIPS.[avg_fragmentation_in_percent] &gt; 15
   AND SDDIPS.[page_count] &gt; 2
   AND SDDIPS.[index_id] &gt; 0
ORDER BY OBJECT_SCHEMA_NAME(SDDIPS.[object_id]), OBJECT_NAME(SDDIPS.[object_id])</description>
		<content:encoded><![CDATA[<p>USE [XXXXXXXXX]<br />
GO<br />
SELECT<br />
   SI.[name] AS index_name,<br />
   OBJECT_SCHEMA_NAME(SDDIPS.[object_id]) + &#8216;.&#8217; + OBJECT_NAME(SDDIPS.[object_id]) AS [object_name],<br />
   SDDIPS.[index_type_desc], SDDIPS.[avg_fragmentation_in_percent]<br />
FROM sys.[dm_db_index_physical_stats](DB_ID(), NULL, NULL, NULL, &#8216;Detailed&#8217;) SDDIPS<br />
   INNER JOIN sys.[indexes] SI ON SDDIPS.[object_id] = SI.[object_id]<br />
       AND SDDIPS.[index_id] = SI.[index_id]<br />
WHERE SDDIPS.[avg_fragmentation_in_percent] &gt; 15<br />
   AND SDDIPS.[page_count] &gt; 2<br />
   AND SDDIPS.[index_id] &gt; 0<br />
ORDER BY OBJECT_SCHEMA_NAME(SDDIPS.[object_id]), OBJECT_NAME(SDDIPS.[object_id])</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Object Caching 364/364 objects using disk: basic

Served from: thesqlagentman.com @ 2012-05-17 17:33:27 -->
