<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SMO Archives - DBAduck</title>
	<atom:link href="https://www.dbaduck.com/tag/smo/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbaduck.com/tag/smo/</link>
	<description>DBA</description>
	<lastBuildDate>Wed, 18 May 2022 18:49:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.5</generator>

<image>
	<url>https://www.dbaduck.com/wp-content/uploads/2013/12/cropped-dbaducklogo-2-32x32.png</url>
	<title>SMO Archives - DBAduck</title>
	<link>https://www.dbaduck.com/tag/smo/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SMO and Index Fragmentation</title>
		<link>https://www.dbaduck.com/smo-and-index-fragmentation/</link>
					<comments>https://www.dbaduck.com/smo-and-index-fragmentation/#comments</comments>
		
		<dc:creator><![CDATA[dbaduck]]></dc:creator>
		<pubDate>Sun, 08 Jul 2012 04:51:34 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SMO]]></category>
		<category><![CDATA[Fragmentation]]></category>
		<category><![CDATA[Index]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">http://www.benmiller.net/?p=55</guid>

					<description><![CDATA[<p>When working with SMO and Indexes there are times that you want to get the fragmentation of this particular index.&#160; In SMO there is a method on the Index called EnumFragmentation.&#160; When you call this method, there is a bug in SMO out on Connect (SMO Index Enum Fragmentation&#8230;) that you should vote for.&#160; This [&#8230;]</p>
<p>The post <a href="https://www.dbaduck.com/smo-and-index-fragmentation/">SMO and Index Fragmentation</a> appeared first on <a href="https://www.dbaduck.com">DBAduck</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When working with SMO and Indexes there are times that you want to get the fragmentation of this particular index.&nbsp; In SMO there is a method on the Index called <a title="Enum Fragmentation" href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.index.enumfragmentation.aspx" target="_blank" rel="noopener noreferrer">EnumFragmentation</a>.&nbsp; When you call this method, there is a bug in SMO out on Connect (<a title="SMO Fragmentation Bug" href="https://connect.microsoft.com/SQLServer/feedback/details/713488/smo-index-enumfragmentation-method-analyzes-entire-database-not-just-the-individual-index" target="_blank" rel="noopener noreferrer">SMO Index Enum Fragmentation&#8230;</a>) that you should vote for.&nbsp; This is a very impactful bug as this is the only way in SMO to get the Fragmenation information on an Index.</p>
<p>The bug is this.&nbsp; When you call EnumFragmentation() you get the entire Database fragmentation by index instead of for the Index that you are calling it from.&nbsp; Normally what you would expect is to see</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="sql" name="mshighlighter" >
select *
from sys.dm_db_index_physical_stats(9, 39399393, NULL, NULL, 'SAMPLED')</textarea></pre>
</div>
<p>Instead you see</p>
<div class="my-syntax-highlighter">
<pre><textarea id="mshighlighter" class="mshighlighter" language="sql" name="mshighlighter" >
select *
from sys.dm_db_index_physical_stats(NULL, NULL, NULL, NULL, 'LIMITED')</textarea></pre>
</div>
<p>This is crazy as you only get a limited set, which I know you can change with the method above by specifying the type of Detail (&#8216;DETAILED&#8217;, &#8216;SAMPLED&#8217;, &#8216;LIMITED&#8217;) but it defaults to LIMITED.</p>
<p>Vote up the bug if this is something that affects you and your work.</p>
<p>The post <a href="https://www.dbaduck.com/smo-and-index-fragmentation/">SMO and Index Fragmentation</a> appeared first on <a href="https://www.dbaduck.com">DBAduck</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbaduck.com/smo-and-index-fragmentation/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
