<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The SQL Dude!</title>
	<atom:link href="http://thesqldude.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesqldude.com</link>
	<description>Pages that teach you the SQL way of life!</description>
	<lastBuildDate>Tue, 09 Apr 2013 13:26:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thesqldude.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5380c3ab3ebf199aeccec3583af5040d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>The SQL Dude!</title>
		<link>http://thesqldude.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thesqldude.com/osd.xml" title="The SQL Dude!" />
	<atom:link rel='hub' href='http://thesqldude.com/?pushpress=hub'/>
		<item>
		<title>A scenario on Query Tuning&#8211;Included Columns are a good thing!</title>
		<link>http://thesqldude.com/2012/12/20/a-scenario-on-query-tuningincluded-columns-are-a-good-thing/</link>
		<comments>http://thesqldude.com/2012/12/20/a-scenario-on-query-tuningincluded-columns-are-a-good-thing/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 21:29:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Query Optimization]]></category>
		<category><![CDATA[covering index]]></category>
		<category><![CDATA[forceseek]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[included columns]]></category>
		<category><![CDATA[optimizer]]></category>
		<category><![CDATA[performance tuning]]></category>
		<category><![CDATA[query tuning]]></category>
		<category><![CDATA[scan vs seek]]></category>
		<category><![CDATA[slow query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[thesqldude]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=434</guid>
		<description><![CDATA[Well, this post has been due for quite some time. I had opened up a survey/opinion poll on http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/ sometime back and as expected most of you out there want to see more on performance tuning and query optimization. &#160; Figure 1: Opinion Poll Results Without much ado and by popular demand here goes a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=434&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">Well, this post has been due for quite some time. I had opened up a survey/opinion poll on <a title="http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/" href="http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/"><font color="#0000ff">http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/</font></a> sometime back and as expected most of you out there want to see more on performance tuning and query optimization.</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image10.png"><img title="image" style="background-image:none;padding-top:0;padding-left:0;margin:5px;display:inline;padding-right:0;border-width:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb10.png?w=393&#038;h=300" width="393" height="300" /></a></p>
<p align="left">&#160; Figure 1: Opinion Poll Results</p>
<p><font size="2"><em>Without much ado and by popular demand here goes a simple scenario on query tuning.</em></font></p>
<p><img title="" style="margin:5px;" alt="Tuning" src="http://loadstorm.com/files/TuneUp.jpg" width="155" height="159" /></p>
<hr />
<p><font size="2">One of my engineers came to me with the following scenario…</font></p>
<p><font size="2"><u><strong>Problem Statement</strong></u></font></p>
<p><font size="2">We have this Update query that is taking much longer to run compared to before. No schema changes have been made though its quite possible data changes have been happening. The update query goes like this,</font></p>
<blockquote><pre class="code"><font size="2"><span style="color:blue;">update </span>msgboard <span style="color:blue;">set </span>mb_status <span style="color:gray;">=</span>10<span style="color:gray;">, </span>mb_changed_by <span style="color:gray;">=</span></font><font size="2"><span style="color:red;">'SATCOM'  
</span><span style="color:blue;">from </span>msgboard 
<span style="color:blue;">where </span>mb_type <span style="color:gray;">= </span>210</font> </pre>
</blockquote>
<p><font size="2"><strong><u>Table Schema</u></strong></font></p>
<p><font size="2">I was easily able to reproduce this issue on my instance, here is how my table setup looks.</font></p>
<blockquote>
<pre class="code"><span style="color:green;"><font size="2">/****** Object:  Table [dbo].[msgboard]    Script Date: 12/20/2012 01:52:07 ******/
</font></span><font size="2"><span style="color:blue;">SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE </span>[dbo]<span style="color:gray;">.</span>[msgboard]</font><font size="2"><span style="color:gray;">(
    </span>[mb_id] [int] </font><font size="2"><span style="color:gray;">NOT NULL,
    </span>[mb_type] [int] </font><font size="2"><span style="color:gray;">NOT NULL,
    </span>[mb_status] [int] </font><font size="2"><span style="color:gray;">NOT NULL,
    </span>[mb_changed_by] [varchar]<span style="color:gray;">(</span>50</font><font size="2"><span style="color:gray;">) NULL,
    </span>[mb_changed_dt]  <span style="color:blue;">AS </span><span style="color:gray;">(</span><span style="color:magenta;">getdate</span></font><font size="2"><span style="color:gray;">())
) </span><span style="color:blue;">ON </span>[PRIMARY]
</font><font size="2"><span style="color:blue;">GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE CLUSTERED INDEX </span>[pk_msgboard] <span style="color:blue;">ON </span>[dbo]<span style="color:gray;">.</span>[msgboard] 
</font><font size="2"><span style="color:gray;">(
    </span>[mb_id] </font><font size="2"><span style="color:blue;">ASC
</span><span style="color:gray;">)</span><span style="color:blue;">WITH </span><span style="color:gray;">(</span><span style="color:blue;">PAD_INDEX  </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">STATISTICS_NORECOMPUTE  </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">SORT_IN_TEMPDB </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">IGNORE_DUP_KEY </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">DROP_EXISTING </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">ONLINE </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">ALLOW_ROW_LOCKS  </span><span style="color:gray;">= </span><span style="color:blue;">ON</span><span style="color:gray;">, </span><span style="color:blue;">ALLOW_PAGE_LOCKS  </span><span style="color:gray;">= </span><span style="color:blue;">ON</span><span style="color:gray;">, </span><span style="color:blue;">FILLFACTOR </span><span style="color:gray;">= </span>100<span style="color:gray;">) </span><span style="color:blue;">ON </span>[PRIMARY]
</font><font size="2"><span style="color:blue;">GO
CREATE NONCLUSTERED INDEX </span>[IX_msgboard_type] <span style="color:blue;">ON </span>[dbo]<span style="color:gray;">.</span>[msgboard] 
</font><font size="2"><span style="color:gray;">(
    </span>[mb_type] <span style="color:blue;">ASC</span></font><font size="2"><span style="color:gray;">,
    </span>[mb_status] </font><font size="2"><span style="color:blue;">ASC
</span><span style="color:gray;">)</span><span style="color:blue;">WITH </span><span style="color:gray;">(</span><span style="color:blue;">PAD_INDEX  </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">STATISTICS_NORECOMPUTE  </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">SORT_IN_TEMPDB </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">IGNORE_DUP_KEY </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">DROP_EXISTING </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">ONLINE </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">ALLOW_ROW_LOCKS  </span><span style="color:gray;">= </span><span style="color:blue;">ON</span><span style="color:gray;">, </span><span style="color:blue;">ALLOW_PAGE_LOCKS  </span><span style="color:gray;">= </span><span style="color:blue;">ON</span><span style="color:gray;">) </span><span style="color:blue;">ON </span>[PRIMARY]
</font><span style="color:blue;"><font size="2">GO</font>
</span></pre>
</blockquote>
<p><font size="2">I populated this table with some sample data of 1000 rows using the following script.</font></p>
<blockquote>
<pre class="code"><font size="2"><span style="color:blue;">declare </span>@counter </font><font size="2"><span style="color:blue;">int
set </span>@counter<span style="color:gray;">=</span>0
<span style="color:blue;">declare </span>@mbid </font><font size="2"><span style="color:blue;">int
set </span>@mbid<span style="color:gray;">=</span>1
<span style="color:blue;">declare </span>@mbtype </font><font size="2"><span style="color:blue;">int
set </span>@mbtype<span style="color:gray;">=</span>200
<span style="color:blue;">declare </span>@mbstatus </font><font size="2"><span style="color:blue;">int
set </span>@mbstatus<span style="color:gray;">=</span>10
<span style="color:blue;">while</span><span style="color:gray;">(</span>@counter<span style="color:gray;">&lt;</span>1000</font><span style="color:gray;"><font size="2">)
</font></span><font size="2"><span style="color:blue;">begin
INSERT INTO </span>[dbo]<span style="color:gray;">.</span>[msgboard]
           <span style="color:gray;">(</span>[mb_id]
           <span style="color:gray;">,</span>[mb_type]
           <span style="color:gray;">,</span>[mb_status]
           <span style="color:gray;">,</span>[mb_changed_by]</font><span style="color:gray;"><font size="2">)
     </font></span><font size="2"><span style="color:blue;">VALUES
           </span><span style="color:gray;">(</span>@mbid<span style="color:gray;">,</span>@mbtype<span style="color:gray;">,</span>@mbstatus<span style="color:gray;">,</span><span style="color:red;">'THESQLDUDE'</span></font><font size="2"><span style="color:gray;">)
</span><span style="color:blue;">set </span>@mbid<span style="color:gray;">+=</span>1
<span style="color:blue;">set </span>@counter<span style="color:gray;">+=</span>1
</font><span style="color:blue;"><font size="2">end
GO</font></span></pre>
<pre class="code"><span style="color:blue;">INSERT INTO </span>[test]<span style="color:gray;">.</span>[dbo]<span style="color:gray;">.</span>[msgboard]
           <span style="color:gray;">(</span>[mb_id]
           <span style="color:gray;">,</span>[mb_type]
           <span style="color:gray;">,</span>[mb_status]
           <span style="color:gray;">,</span>[mb_changed_by]<span style="color:gray;">)
     </span><span style="color:blue;">VALUES
           </span><span style="color:gray;">(</span>1001<span style="color:gray;">,</span>210<span style="color:gray;">,</span>10<span style="color:gray;">,</span><span style="color:red;">'MANWITHNONAME'</span><span style="color:gray;">)</span></pre>
<p>  <font color="#0000ff" size="2" face="Courier New"></font></p></blockquote>
<p><font size="2">So, I have 2 indexes on this table:-</font></p>
<p><font size="2">1) A unique Clustered Index pk_msgboard on the mb_id column</font></p>
<p><font size="2">2) A composite non-clustered index IX_msgboard_type on the columns mb_type and mb_status (in this order).</font></p>
<p><font size="2"></font></p>
<p><font size="2"><strong><u>Query Execution Details</u></strong></font></p>
<p><font size="2">Here is what I observed when I ran the following update statement.</font></p>
<pre class="code"><font size="2"><span style="color:blue;">update </span>msgboard <span style="color:blue;">set </span>mb_status <span style="color:gray;">=</span>10<span style="color:gray;">, </span>mb_changed_by <span style="color:gray;">=</span></font><font size="2"><span style="color:red;">'SATCOM'  
</span><span style="color:blue;">from </span>msgboard 
<span style="color:blue;">where </span>mb_type <span style="color:gray;">= </span>210</font> </pre>
<p><font size="2">To actual execution plan looks like this,</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image11.png"><img title="image" style="background-image:none;padding-top:0;padding-left:0;margin:5px;display:inline;padding-right:0;border-width:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb11.png?w=1240&#038;h=155" width="1240" height="155" /></a></p>
<p><font color="#ff0000" size="2">Total Cost: 0.03124485</font></p>
<p><font size="2">As you can see, this query is using the Clustered Index pk_msgboard and its performing a Scan. At this point, two questions should pop into your head</font></p>
<p><font size="2">1. Why is the query using the clustered index?</font></p>
<p><font size="2">2. Why is it performing a Scan operation?</font></p>
<p><font size="2"><u>Answer to question #1</u></font></p>
<p><font size="2">Let’s look at the update query carefully. The query is updating the columns mb_status and mb_changed_by, and there is a filter on column mb_type. You might think, well, I have an index IX_msgboard_type on the mb_type column, why is SQL Server not using this non-clustered index?</font></p>
<p><font size="2">To prove I was smarter than SQL Server optimizer, I forced it to use the non-clustered index by adding an index hint. The query looks like this,</font></p>
<pre class="code"><font size="2"><span style="color:blue;">update </span>msgboard <span style="color:blue;">set </span>mb_status <span style="color:gray;">=</span>10<span style="color:gray;">, </span>mb_changed_by <span style="color:gray;">=</span></font><font size="2"><span style="color:red;">'SATCOM'  
</span><span style="color:blue;">from </span>msgboard <font style="background-color:#ffff00;"><span style="color:blue;">WITH</span><span style="color:gray;">(</span><span style="color:blue;">INDEX</span><span style="color:gray;">(</span>IX_msgboard_type</font></font><font size="2"><span style="color:gray;"><font style="background-color:#ffff00;">))</font>
</span><span style="color:blue;">where </span>mb_type <span style="color:gray;">= </span>210</font> </pre>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image12.png"><img title="image" style="background-image:none;padding-top:0;padding-left:0;margin:5px;display:inline;padding-right:0;border-width:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb12.png?w=1366&#038;h=158" width="1366" height="158" /></a></p>
<p><font color="#ff0000" size="2">Total Cost: 0.03651106 </font></p>
<ul>
<li><font color="#000000" size="2">Notice that the Cost for the query with index hint is higher than the one without! If the table had more rows, we would have seen a bigger difference in cost <img class="wlEmoticon wlEmoticon-smile" style="border-style:none;" alt="Smile" src="http://thesqldude.files.wordpress.com/2012/12/wlemoticon-smile.png" />.</font> </li>
<li><font color="#000000" size="2">Additionally, a Table Spool operator is now part of the execution plan. The table spool operator caches the row to be updated (In tempdb) and then feeds it to the Clustered Index update operator.</font> </li>
<li><font color="#000000" size="2">This proves that SQL Server optimizer was actually choosing the cheapest and best plan it could come up with.</font> </li>
</ul>
<p><font size="2">The reason SQL Server picked the clustered index is because the query is updating the columns mb_status =10 and mb_changed_by. This column mb_status is not the leading column in the NC index IX_msgboard_type, but the 2nd column. Why does this matter? It does because, the statistics for this NC index would be built on the leading column which is mb_type. Here is how the histogram looks.</font></p>
<pre class="code"><font size="2"><span style="color:blue;">dbcc show_statistics </span><span style="color:gray;">(</span><span style="color:red;">'dbo.msgboard'</span><span style="color:gray;">,</span><span style="color:red;">'IX_msgboard_type'</span><span style="color:gray;">)</span></font></pre>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image13.png"><img title="image" style="background-image:none;padding-top:0;padding-left:0;margin:5px;display:inline;padding-right:0;border-width:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb13.png?w=509&#038;h=283" width="509" height="283" /></a></p>
<p><font size="2">To avoid a bookmark lookup (Key Lookup operator from SQL 2005 onwards), SQL Server decided to use the clustered index since it covers all the columns in the table. If SQL Server were to use the NC index, it would be do a lookup or cache the results (ahem, Table Spool operator!) and then find the matching row in the clustered index to actually update the 2 columns. This is an additional cost, and this is why SQL decided not to go with this plan.</font></p>
<p><font size="2">Coming to the 2nd question of why a Scan? It might surprise some of you, but a Seek does not imply good performance always. My favourite answer – “It depends”. In this case, the table only had 1001 rows and of which only 1 row (mb_id=1001) qualified for the update. When using the CI Scan, SQL Server was applying the filter on mb_type=210 and that returned 1 row back. A Clustered Index Seek in this case would not make any <strong><u><font color="#ff0000">positive</font></u></strong> difference in query execution time.</font></p>
<blockquote>
<p><font size="2">OBJECT:([test].[dbo].[msgboard].[pk_msgboard]), WHERE:([test].[dbo].[msgboard<font style="background-color:#ffff00;"></font></font><font size="2">].</font><font size="2"><font style="background-color:#ffff00;">[mb_type]=(210)</font>) ORDERED</font></p>
</blockquote>
<p><font size="2">To test this, I added the FORCESEEK table hint to this update query and as expected the query did not run faster.</font></p>
<blockquote>
<pre class="code"><font size="2"><span style="color:blue;">update </span>msgboard <span style="color:blue;">set </span>mb_status <span style="color:gray;">=</span>10<span style="color:gray;">, </span>mb_changed_by <span style="color:gray;">=</span></font><font size="2"><span style="color:red;">'SATCOM'  
</span><span style="color:blue;">from </span>msgboard <span style="color:blue;">WITH </span><span style="color:gray;">(</span>FORCESEEK<span style="color:gray;">) </span><span style="color:blue;">where </span>mb_type <span style="color:gray;">= </span>210</font> </pre>
</blockquote>
<p><span style="color:gray;"></p>
<pre class="code"><font size="2"></font></pre>
<pre class="code"></span><font size="2"><font face="Verdana">In fact it has the same cost as the query with index hint –&gt; <font color="#ff0000"><strong>0.03651106</strong></font></font></font></pre>
<pre class="code"><strong><font color="#ff0000" size="2" face="Verdana"></font></strong>&#160;</pre>
<p><font size="2"></font></p>
<p><strong><u><font size="3">Solution</font></u></strong></p>
<p><font size="2">Instead of trying to second guess the query optimizer and trying to tweak the execution plan it is producing, this issue needs a different approach –&gt; back to basics. Based on the query design, if the column being updated mb_status was “covered” then it would help. In this case that was also also take care of, since IX_msgboard_type also includes the column mb_status, though as a non-key column. This is an important thing and this was why the “<a href="http://msdn.microsoft.com/en-us/library/ms190806.aspx" target="_blank"><font color="#0000ff">included columns</font></a>” feature was introduced.</font></p>
<p><font size="2">So, I modified the index IX_msgboard_type to remove the column mb_status. Instead, I added the column back as an included column</font></p>
<pre class="code"><font size="2"><span style="color:blue;">DROP INDEX </span>[IX_msgboard_type] <span style="color:blue;">ON </span>[dbo]<span style="color:gray;">.</span>[msgboard] <span style="color:blue;">WITH </span><span style="color:gray;">( </span><span style="color:blue;">ONLINE </span><span style="color:gray;">= </span><span style="color:blue;">OFF </span></font><span style="color:gray;"><font size="2">)
</font></span><font size="2"><span style="color:blue;">GO
CREATE NONCLUSTERED INDEX </span>[IX_msgboard_type] <span style="color:blue;">ON </span>[dbo]<span style="color:gray;">.</span>[msgboard] 
</font><font size="2"><span style="color:gray;">(
    </span>[mb_type] </font><span style="color:blue;"><font size="2">ASC
</font></span><font size="2"><span style="color:gray;">)
</span><span style="color:blue;">INCLUDE </span><span style="color:gray;">( </span>[mb_status]<span style="color:gray;">) </span><span style="color:blue;">WITH </span><span style="color:gray;">(</span><span style="color:blue;">STATISTICS_NORECOMPUTE  </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">SORT_IN_TEMPDB </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">IGNORE_DUP_KEY </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">DROP_EXISTING </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">ONLINE </span><span style="color:gray;">= </span><span style="color:blue;">OFF</span><span style="color:gray;">, </span><span style="color:blue;">ALLOW_ROW_LOCKS  </span><span style="color:gray;">= </span><span style="color:blue;">ON</span><span style="color:gray;">, </span><span style="color:blue;">ALLOW_PAGE_LOCKS  </span><span style="color:gray;">= </span><span style="color:blue;">ON</span><span style="color:gray;">) </span><span style="color:blue;">ON </span>[PRIMARY]
<span style="color:blue;">GO</span></font></pre>
<p><font size="2">The biggest advantage of having an included column in a non-clustered index is that, the query optimizer can locate all the column values within the index. The base table or clustered index data is not accessed resulting in fewer disk I/O operations and hence faster query execution. Also, the index size is lesser since non-key columns are only added to the leaf level. Many advantages indeed.</font></p>
<p><font size="2">Here is how the update query plan looked after added mb_status as an included column.</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image14.png"><img title="image" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb14.png?w=793&#038;h=139" width="793" height="139" /></a><font size="2"></font></p>
<p><font size="2">My oh my, this plan looks so simple, clean and yeah faster. The actual cost is now <font color="#ff0000"><strong>0.0132843</strong><font color="#000000">, which is a big improvement over the original plan of </font><font color="#ff0000"><strong>0.03651106</strong></font> </font></font></p>
<p><font size="2">So we have achieved our original goals of </font></p>
<p><font size="2">a) Getting SQL Server to use the Non-clustered index IX_msgboard_type, instead of the clustered index.</font></p>
<p><font size="2">b) Getting an Seek operation instead of a Scan.</font></p>
<p><font size="2">c) Query cost is cheaper.</font></p>
<hr />
<p>
    <br /><font size="2">So, hope everyone understood how beneficial included columns are on non-clustered indexes. For more information on guidelines and restriction with included columns refer <a href="http://msdn.microsoft.com/en-us/library/ms190806.aspx" target="_blank"><font color="#0000ff">this MSDN article</font></a><font color="#0000ff">.</font></font></p>
<p><font size="2">That’s all for now folks. Keep tuned to this site for more.</font></p>
<p><font size="2"></font></p>
<p><font size="2"></font></p>
<p><font size="2">-TheSQLDude (Sudarshan)</font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/covering-index/'>covering index</a>, <a href='http://thesqldude.com/tag/forceseek/'>forceseek</a>, <a href='http://thesqldude.com/tag/hint/'>hint</a>, <a href='http://thesqldude.com/tag/included-columns/'>included columns</a>, <a href='http://thesqldude.com/tag/optimizer/'>optimizer</a>, <a href='http://thesqldude.com/tag/performance-tuning/'>performance tuning</a>, <a href='http://thesqldude.com/tag/query-tuning/'>query tuning</a>, <a href='http://thesqldude.com/tag/scan-vs-seek/'>scan vs seek</a>, <a href='http://thesqldude.com/tag/slow-query/'>slow query</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=434&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/12/20/a-scenario-on-query-tuningincluded-columns-are-a-good-thing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://loadstorm.com/files/TuneUp.jpg" medium="image">
			<media:title type="html">Tuning</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>T-SQL Script to find the size of every index in the database</title>
		<link>http://thesqldude.com/2012/12/15/t-sql-script-to-find-the-size-of-every-index-in-the-database/</link>
		<comments>http://thesqldude.com/2012/12/15/t-sql-script-to-find-the-size-of-every-index-in-the-database/#comments</comments>
		<pubDate>Fri, 14 Dec 2012 21:35:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[DB Maintenance]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[index size]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[pages_used]]></category>
		<category><![CDATA[page_count]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[sysindexes]]></category>
		<category><![CDATA[thesqldude]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=419</guid>
		<description><![CDATA[I wrote this query to find the size of all indexes in the database for one of my customers. Thought I’d share this script with everyone. Cheers. CREATE PROCEDURE uspIndexSizeinDB AS -- Author: Sudarshan (TheSQLDude.com) -- Data Created: Dec 15, 2012 -- Description: Calculate the SQL Server index size for all indexes in the current [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=419&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">I wrote this query to find the size of all indexes in the database for one of my customers. Thought I’d share this script with everyone. Cheers.</font></p>
<hr />
<pre class="code"><font size="2"><span style="color:blue;">CREATE PROCEDURE </span>uspIndexSizeinDB
</font><span style="color:blue;"><font size="2">AS 
</font></span><span style="color:green;"><font size="2">-- Author: Sudarshan (TheSQLDude.com)
-- Data Created: Dec 15, 2012
-- Description: Calculate the SQL Server index size for all indexes in the current database
  </font></span><font size="2"><span style="color:blue;">BEGIN 
    DECLARE  </span>@IndexSize <span style="color:blue;">BIGINT</span></font><font size="2"><span style="color:gray;">, 
             </span>@IndexID   <span style="color:blue;">INT</span></font><font size="2"><span style="color:gray;">,
             </span>@IndexName <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span>200</font><font size="2"><span style="color:gray;">),
             </span>@IndexType <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span>50</font><font size="2"><span style="color:gray;">),
             </span>@ObjectID  </font><font size="2"><span style="color:blue;">INT
     
    SET </span>@IndexSize <span style="color:gray;">= </span>0
    
    <span style="color:blue;">create table </span>#tmpresults <span style="color:gray;">(</span>ObjName <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span>100<span style="color:gray;">), </span>IndexID <span style="color:blue;">int</span><span style="color:gray;">, </span>IndexName <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span>200<span style="color:gray;">),</span>[IndexSize(MB)] <span style="color:blue;">int</span><span style="color:gray;">, </span>IndexType <span style="color:blue;">nvarchar</span><span style="color:gray;">(</span>50</font><font size="2"><span style="color:gray;">))
    
    </span><span style="color:blue;">DECLARE </span>curIndex </font><font size="2"><span style="color:blue;">CURSOR  FOR 
    SELECT </span>sysind<span style="color:gray;">.</span><span style="color:magenta;">object_id</span><span style="color:gray;">, </span>sysind<span style="color:gray;">.</span>index_id<span style="color:gray;">, </span>sysind<span style="color:gray;">.</span>name<span style="color:gray;">, </span>sysind<span style="color:gray;">.</span>type_desc 
    <span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">indexes </span>sysind 
    <span style="color:gray;">join </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">sysobjects </span>sysobj
    <span style="color:blue;">on </span>sysind<span style="color:gray;">.</span><span style="color:magenta;">object_id </span><span style="color:gray;">= </span>sysobj<span style="color:gray;">.</span>id
    <span style="color:blue;">where </span>sysind<span style="color:gray;">.</span><span style="color:blue;">type</span><span style="color:gray;">&gt;</span>0 <span style="color:gray;">and </span>sysobj<span style="color:gray;">.</span><span style="color:blue;">type </span><span style="color:gray;">not in (</span><span style="color:red;">'S'</span><span style="color:gray;">,</span><span style="color:red;">'IT'</span></font><font size="2"><span style="color:gray;">)
    </span><span style="color:blue;">order by </span>sysobj<span style="color:gray;">.</span>id </font><font size="2"><span style="color:blue;">asc
   
    OPEN </span>curIndex 
     
    <span style="color:blue;">FETCH NEXT FROM </span>curIndex 
    <span style="color:blue;">INTO </span>@ObjectID<span style="color:gray;">, </span>@IndexID<span style="color:gray;">, </span>@IndexName<span style="color:gray;">, </span>@IndexType
     
    <span style="color:blue;">WHILE </span><span style="color:gray;">(</span><span style="color:magenta;">@@FETCH_STATUS </span><span style="color:gray;">= </span>0</font><span style="color:gray;"><font size="2">) 
      </font></span><font size="2"><span style="color:blue;">BEGIN 
        SELECT </span>@IndexSize <span style="color:gray;">= </span><span style="color:magenta;">sum</span><span style="color:gray;">(</span>avg_record_size_in_bytes <span style="color:gray;">* </span>record_count</font><font size="2"><span style="color:gray;">) 
        </span><span style="color:blue;">FROM   </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_db_index_physical_stats</span><span style="color:gray;">(</span><span style="color:magenta;">DB_ID</span><span style="color:gray;">(),</span>@ObjectID<span style="color:gray;">, </span>@IndexID<span style="color:gray;">, NULL, </span><span style="color:red;">'detailED'</span></font><font size="2"><span style="color:gray;">) 
         
        </span><span style="color:blue;">insert into </span>#tmpresults <span style="color:gray;">(</span>ObjName<span style="color:gray;">, </span>IndexID<span style="color:gray;">, </span>IndexName<span style="color:gray;">, </span>[IndexSize(MB)]<span style="color:gray;">, </span>IndexType</font><font size="2"><span style="color:gray;">)
        </span><span style="color:blue;">SELECT </span>TableName <span style="color:gray;">= </span><span style="color:magenta;">OBJECT_NAME</span><span style="color:gray;">(</span>@ObjectID</font><font size="2"><span style="color:gray;">), 
               </span>IndexID <span style="color:gray;">= </span>@IndexID</font><font size="2"><span style="color:gray;">, 
               </span>IndexName <span style="color:gray;">= </span>@IndexName</font><font size="2"><span style="color:gray;">,
               </span>[IndexSize(MB)] <span style="color:gray;">= </span><span style="color:magenta;">CONVERT</span><span style="color:gray;">(</span><span style="color:blue;">DECIMAL</span><span style="color:gray;">(</span>16<span style="color:gray;">,</span>1<span style="color:gray;">),(</span>@IndexSize <span style="color:gray;">/ (</span>1024.0 <span style="color:gray;">* </span>1024<span style="color:gray;">))), </span>IndexType <span style="color:gray;">= </span>@IndexType
         
        <span style="color:blue;">FETCH NEXT FROM </span>curIndex 
        <span style="color:blue;">INTO </span>@ObjectID<span style="color:gray;">, </span>@IndexID<span style="color:gray;">, </span>@IndexName<span style="color:gray;">, </span>@IndexType
      </font><font size="2"><span style="color:blue;">END 
    CLOSE </span>curIndex 
    <span style="color:blue;">DEALLOCATE </span>curIndex 
    
    <span style="color:blue;">select </span><span style="color:magenta;">UPPER</span><span style="color:gray;">(</span>ObjName<span style="color:gray;">) </span><span style="color:blue;">as </span>ObjectName<span style="color:gray;">, </span>IndexID<span style="color:gray;">, </span>IndexName<span style="color:gray;">, </span>IndexType<span style="color:gray;">, </span>[IndexSize(MB)]  <span style="color:blue;">from </span>#tmpresults <span style="color:blue;">order by </span>[IndexSize(MB)] </font><span style="color:blue;"><font size="2">desc
  END 
GO</font></span></pre>
<hr />
<br /> Tagged: <a href='http://thesqldude.com/tag/index-size/'>index size</a>, <a href='http://thesqldude.com/tag/indexes/'>indexes</a>, <a href='http://thesqldude.com/tag/pages_used/'>pages_used</a>, <a href='http://thesqldude.com/tag/page_count/'>page_count</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/sysindexes/'>sysindexes</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=419&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/12/15/t-sql-script-to-find-the-size-of-every-index-in-the-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>
	</item>
		<item>
		<title>Scripts to monitor SQL Server Memory usage in Buffer Pool, Plan Cache and identify Query Memory grants &amp; waits by session</title>
		<link>http://thesqldude.com/2012/12/14/scripts-to-monitor-sql-server-memory-usage-in-buffer-pool-plan-cache-and-identify-query-memory-grants-waits-by-session/</link>
		<comments>http://thesqldude.com/2012/12/14/scripts-to-monitor-sql-server-memory-usage-in-buffer-pool-plan-cache-and-identify-query-memory-grants-waits-by-session/#comments</comments>
		<pubDate>Thu, 13 Dec 2012 21:31:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Memory]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[701]]></category>
		<category><![CDATA[buffer pool]]></category>
		<category><![CDATA[dmv]]></category>
		<category><![CDATA[memory usage]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[OOM]]></category>
		<category><![CDATA[out of memory]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[thesqldude]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=418</guid>
		<description><![CDATA[I often use a multitude of T-SQL queries and scripts when I am troubleshooting memory issues and even for monitoring SQL Server Memory usage. I am posting these scripts here in the spirit of sharing, as I&#8217;m sure there are other variations of these same scripts out there already. For this purpose of this blog [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=418&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">I often use a multitude of T-SQL queries and scripts when I am troubleshooting memory issues and even for monitoring SQL Server Memory usage. I am posting these scripts here in the spirit of sharing, as I&#8217;m sure there are other variations of these same scripts out there already. For this purpose of this blog post, these scripts are only useful in troubleshooting out-of-memory (OOM) and other issues in the Buffer Pool. This blog post does not cover Virtual Address/Virtual Memory or memory tracking outside of the Buffer Pool. That will be covered in a later post.</font></p>
<p><font size="2">In case you have other scripts for memory monitoring, please leave behind a comment</font></p>
<hr />
<p><font size="2"><span style="color:green;">&#8211; Query to find the Buffer Pool usage per each Database       <br />&#8211; Each of these pages are present in the Buffer Cache, meaning they are IN_RAM pages.        </p>
<p></span><span style="color:blue;">DECLARE </span>@total_buffer <span style="color:blue;">INT</span></font><font size="2"><span style="color:gray;">;       <br /></span><span style="color:blue;">SELECT </span>@total_buffer <span style="color:gray;">= </span>cntr_value      <br />&#160;&#160; <span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span></font><font size="2"><span style="color:green;">dm_os_performance_counters        <br />&#160;&#160; </span><span style="color:blue;">WHERE </span><span style="color:magenta;">RTRIM</span><span style="color:gray;">(</span>[object_name]<span style="color:gray;">) LIKE</span></font><font size="2"><span style="color:red;">&#8216;%Buffer Manager&#8217;       <br />&#160;&#160; </span><span style="color:gray;">AND </span>counter_name <span style="color:gray;">= </span><span style="color:red;">&#8216;Total Pages&#8217;</span></font><font size="2"><span style="color:gray;">;       </p>
<p>;</span><span style="color:blue;">WITH </span>BufCount </font><span style="color:blue;"><font size="2">AS       <br /></font></span><span style="color:gray;"><font size="2">(       <br />&#160; </font></span><font size="2"><span style="color:blue;">SELECT        <br />&#160;&#160;&#160;&#160;&#160;&#160; </span>database_id<span style="color:gray;">, </span>db_buffer_pages <span style="color:gray;">= </span><span style="color:magenta;">COUNT_BIG</span></font><font size="2"><span style="color:gray;">(*)       <br />&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span></font><font size="2"><span style="color:green;">dm_os_buffer_descriptors       <br />&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color:blue;">WHERE </span>database_id <span style="color:gray;">BETWEEN </span>5 <span style="color:gray;">AND </span>32766      <br />&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">GROUP BY </span>database_id      <br /></font><span style="color:gray;"><font size="2">)       <br /></font></span><font size="2"><span style="color:blue;">SELECT       <br />&#160;&#160; </span>[Database_Name] <span style="color:gray;">= </span><span style="color:blue;">CASE </span>[database_id] <span style="color:blue;">WHEN </span>32767       <br />&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:blue;">THEN</span></font><font size="2"><span style="color:red;">&#8216;MSSQL System Resource DB&#8217;        <br />&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color:blue;">ELSE </span><span style="color:magenta;">DB_NAME</span><span style="color:gray;">(</span>[database_id]<span style="color:gray;">) </span><span style="color:blue;">END</span></font><font size="2"><span style="color:gray;">,       <br />&#160;&#160; </span>[Database_ID]</font><font size="2"><span style="color:gray;">,       <br />&#160;&#160; </span>db_buffer_pages <span style="color:blue;">as </span>[Buffer Count (8KB Pages)]</font><font size="2"><span style="color:gray;">,       <br />&#160;&#160; </span>[Buffer Size (MB)] <span style="color:gray;">= </span>db_buffer_pages <span style="color:gray;">/ </span>128</font><font size="2"><span style="color:gray;">,       <br />&#160;&#160; </span>[Buffer Size (%)] <span style="color:gray;">= </span><span style="color:magenta;">CONVERT</span><span style="color:gray;">(</span><span style="color:blue;">DECIMAL</span><span style="color:gray;">(</span>6<span style="color:gray;">,</span>3</font><font size="2"><span style="color:gray;">),        <br />&#160;&#160;&#160;&#160;&#160;&#160; </span>db_buffer_pages <span style="color:gray;">* </span>100.0 <span style="color:gray;">/ </span>@total_buffer</font><font size="2"><span style="color:gray;">)       <br /></span><span style="color:blue;">FROM </span>BufCount      <br /><span style="color:blue;">ORDER BY </span>[Buffer Size (MB)] <span style="color:blue;">DESC</span></font><span style="color:gray;"><font size="2">;</font>      <br /></span></p>
<p><strong><u><font size="2">Output</font></u></strong></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image5.png"><font size="2"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;margin:5px;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb5.png?w=589&#038;h=120" width="589" height="120" /></font></a></p>
<hr />
<pre class="code"><font size="2"><span style="color:green;">-- Query to identify objects that are taking up most of that memory in Buffer Pool.
-- This is only for the current database context. Please prefix &lt;USE DBNAME&gt; as per your requirement

</span><span style="color:blue;">SELECT TOP </span>25 
 <span style="color:magenta;">DB_NAME</span><span style="color:gray;">(</span>bd<span style="color:gray;">.</span>database_id<span style="color:gray;">) </span><span style="color:blue;">as </span>DBNAME</font><font size="2"><span style="color:gray;">,
 </span>obj<span style="color:gray;">.</span>[name] <span style="color:blue;">as </span>[Object Name]</font><font size="2"><span style="color:gray;">,
 </span>sysobj<span style="color:gray;">.</span>type_desc <span style="color:blue;">as </span>[Object Type]</font><font size="2"><span style="color:gray;">,
 </span>i<span style="color:gray;">.</span>[name]   <span style="color:blue;">as </span>[Index Name]</font><font size="2"><span style="color:gray;">,
 </span>i<span style="color:gray;">.</span>[type_desc] <span style="color:blue;">as </span>[Index Type]</font><font size="2"><span style="color:gray;">,
 </span><span style="color:magenta;">count</span><span style="color:gray;">(*)</span><span style="color:blue;">AS </span>Buffered_Page_Count </font><font size="2"><span style="color:gray;">,
 </span><span style="color:magenta;">count</span><span style="color:gray;">(*) * </span>8192 <span style="color:gray;">/ (</span>1024 <span style="color:gray;">* </span>1024<span style="color:gray;">) </span><span style="color:blue;">as </span>Buffer_MB</font><font size="2"><span style="color:gray;">,
 </span>bd<span style="color:gray;">.</span>page_type <span style="color:blue;">as </span>[Page Type] </font><font size="2"><span style="color:green;">-- ,obj.name ,obj.index_id, i.[name]
</span><span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_os_buffer_descriptors </span><span style="color:blue;">AS </span>bd 
    </font><font size="2"><span style="color:gray;">INNER JOIN 
    (
        </span><span style="color:blue;">SELECT </span><span style="color:magenta;">object_name</span><span style="color:gray;">(</span><span style="color:magenta;">object_id</span><span style="color:gray;">) </span><span style="color:blue;">AS </span>name 
            <span style="color:gray;">,</span>index_id <span style="color:gray;">,</span>allocation_unit_id<span style="color:gray;">, </span></font><font size="2"><span style="color:magenta;">object_id
        </span><span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">allocation_units </span><span style="color:blue;">AS </span>au
            <span style="color:gray;">INNER JOIN </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">partitions </span><span style="color:blue;">AS </span>p 
                <span style="color:blue;">ON </span>au<span style="color:gray;">.</span>container_id <span style="color:gray;">= </span>p<span style="color:gray;">.</span>hobt_id 
                    <span style="color:gray;">AND (</span>au<span style="color:gray;">.</span><span style="color:blue;">type </span><span style="color:gray;">= </span>1 <span style="color:gray;">OR </span>au<span style="color:gray;">.</span><span style="color:blue;">type </span><span style="color:gray;">= </span>3</font><font size="2"><span style="color:gray;">)
        </span><span style="color:blue;">UNION </span></font><font size="2"><span style="color:gray;">ALL
        </span><span style="color:blue;">SELECT </span><span style="color:magenta;">object_name</span><span style="color:gray;">(</span><span style="color:magenta;">object_id</span><span style="color:gray;">) </span><span style="color:blue;">AS </span>name   
            <span style="color:gray;">,</span>index_id<span style="color:gray;">, </span>allocation_unit_id<span style="color:gray;">, </span></font><font size="2"><span style="color:magenta;">object_id
        </span><span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">allocation_units </span><span style="color:blue;">AS </span>au
            <span style="color:gray;">INNER JOIN </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">partitions </span><span style="color:blue;">AS </span>p 
                <span style="color:blue;">ON </span>au<span style="color:gray;">.</span>container_id <span style="color:gray;">= </span>p<span style="color:gray;">.</span>hobt_id 
                    <span style="color:gray;">AND </span>au<span style="color:gray;">.</span><span style="color:blue;">type </span><span style="color:gray;">= </span>2
    <span style="color:gray;">) </span><span style="color:blue;">AS </span>obj 
        <span style="color:blue;">ON </span>bd<span style="color:gray;">.</span>allocation_unit_id <span style="color:gray;">= </span>obj<span style="color:gray;">.</span>allocation_unit_id
<span style="color:gray;">LEFT JOIN </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">indexes </span>i <span style="color:blue;">on </span>i<span style="color:gray;">.</span><span style="color:magenta;">object_id </span><span style="color:gray;">= </span>obj<span style="color:gray;">.</span><span style="color:magenta;">object_id </span><span style="color:gray;">AND </span>i<span style="color:gray;">.</span>index_id <span style="color:gray;">= </span>obj<span style="color:gray;">.</span>index_id
<span style="color:gray;">LEFT JOIN </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">objects </span>sysobj <span style="color:blue;">on </span>i<span style="color:gray;">.</span><span style="color:magenta;">object_id </span><span style="color:gray;">= </span>sysobj<span style="color:gray;">.</span></font><font size="2"><span style="color:magenta;">object_id
</span><span style="color:blue;">WHERE </span>database_id <span style="color:gray;">= </span><span style="color:magenta;">DB_ID</span></font><font size="2"><span style="color:gray;">()
and </span>sysobj<span style="color:gray;">.</span><span style="color:blue;">type </span><span style="color:gray;">not in (</span><span style="color:red;">'S'</span><span style="color:gray;">,</span><span style="color:red;">'IT'</span></font><font size="2"><span style="color:gray;">)
</span><span style="color:blue;">GROUP BY </span><span style="color:magenta;">DB_NAME</span><span style="color:gray;">(</span>bd<span style="color:gray;">.</span>database_id<span style="color:gray;">), </span>obj<span style="color:gray;">.</span>name<span style="color:gray;">, </span>obj<span style="color:gray;">.</span>index_id <span style="color:gray;">, </span>i<span style="color:gray;">.</span>[name]<span style="color:gray;">,</span>i<span style="color:gray;">.</span>[type_desc]<span style="color:gray;">,</span>bd<span style="color:gray;">.</span>page_type<span style="color:gray;">,</span>sysobj<span style="color:gray;">.</span>type_desc
<span style="color:blue;">ORDER BY </span>Buffered_Page_Count <span style="color:blue;">DESC</span></font></pre>
<p>
  <br /><strong><u><font size="2">Output</font></u></strong></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image6.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;margin:5px;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb6.png?w=839&#038;h=118" width="839" height="118" /></a></p>
<hr />
<pre class="code"><font size="2"><span style="color:green;">-- Query to show current memory requests, grants and execution plan for each active session
-- This shows memory granted &amp; requested for currently active sessions on the instance level
-- This can be used in a script to capture information over a period of time.

</span><span style="color:blue;">SELECT </span>mg<span style="color:gray;">.</span>session_id<span style="color:gray;">, </span>mg<span style="color:gray;">.</span>requested_memory_kb<span style="color:gray;">, </span>mg<span style="color:gray;">.</span>granted_memory_kb<span style="color:gray;">, </span>mg<span style="color:gray;">.</span>used_memory_kb<span style="color:gray;">, </span>t<span style="color:gray;">.</span><span style="color:blue;">text</span><span style="color:gray;">, </span>qp<span style="color:gray;">.</span>query_plan 
<span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_query_memory_grants </span><span style="color:blue;">AS </span>mg
<span style="color:gray;">CROSS APPLY </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_sql_text</span><span style="color:gray;">(</span>mg<span style="color:gray;">.</span><span style="color:blue;">sql_handle</span><span style="color:gray;">) </span><span style="color:blue;">AS </span>t
<span style="color:gray;">CROSS APPLY </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_query_plan</span><span style="color:gray;">(</span>mg<span style="color:gray;">.</span>plan_handle<span style="color:gray;">) </span><span style="color:blue;">AS </span>qp
<span style="color:blue;">ORDER BY </span>1 <span style="color:blue;">DESC OPTION </span><span style="color:gray;">(</span><span style="color:blue;">MAXDOP </span>1<span style="color:gray;">)</span></font></pre>
<p><font size="2"><strong><u>Output</u></strong></font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image7.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;margin:5px;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb7.png?w=980&#038;h=43" width="980" height="43" /></a></p>
<p><font size="2"><u>Note:</u> When you click on the query_plan, it opens up the XML Showplan in SSMS.</font></p>
<hr />
<pre class="code"><font size="2"><span style="color:green;">-- Query to search plan cache for queries with memory grants completed

</span><span style="color:blue;">SELECT top </span>50 t<span style="color:gray;">.</span><span style="color:blue;">text</span><span style="color:gray;">, </span>cp<span style="color:gray;">.</span>objtype <span style="color:gray;">,</span>qp<span style="color:gray;">.</span>query_plan<span style="color:gray;">, </span>cp<span style="color:gray;">.</span>usecounts<span style="color:gray;">, </span>cp<span style="color:gray;">.</span>size_in_bytes <span style="color:blue;">as </span>[Bytes Used in Cache]
<span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_cached_plans </span><span style="color:blue;">AS </span>cp
<span style="color:gray;">JOIN </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_query_stats </span><span style="color:blue;">AS </span>qs <span style="color:blue;">ON </span>cp<span style="color:gray;">.</span>plan_handle <span style="color:gray;">= </span>qs<span style="color:gray;">.</span>plan_handle
<span style="color:gray;">CROSS APPLY </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_query_plan</span><span style="color:gray;">(</span>cp<span style="color:gray;">.</span>plan_handle<span style="color:gray;">) </span><span style="color:blue;">AS </span>qp
<span style="color:gray;">CROSS APPLY </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_sql_text</span><span style="color:gray;">(</span>qs<span style="color:gray;">.</span><span style="color:blue;">sql_handle</span><span style="color:gray;">) </span><span style="color:blue;">AS </span>t
<span style="color:blue;">WHERE </span>qp<span style="color:gray;">.</span>query_plan<span style="color:gray;">.</span>exist<span style="color:gray;">(</span><span style="color:red;">'declare namespace n=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;; //n:MemoryFractions'</span><span style="color:gray;">) = </span>1
<span style="color:blue;">order by </span>cp<span style="color:gray;">.</span>size_in_bytes </font><font size="2"><span style="color:blue;">desc
OPTION </span><span style="color:gray;">(</span><span style="color:blue;">MAXDOP </span>1<span style="color:gray;">)</span></font></pre>
<p><font size="2"><strong><u>Output</u></strong></font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image8.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb8.png?w=971&#038;h=120" width="971" height="120" /></a></p>
<hr />
<pre class="code"><font size="2"><span style="color:green;">-- Queries that have requested memory or waiting for memory to be granted
</span><span style="color:blue;">SELECT  </span><span style="color:magenta;">DB_NAME</span><span style="color:gray;">(</span>st<span style="color:gray;">.</span><span style="color:blue;">dbid</span><span style="color:gray;">) </span><span style="color:blue;">AS </span>[DatabaseName] </font><font size="2"><span style="color:gray;">,
        </span>mg<span style="color:gray;">.</span>requested_memory_kb </font><font size="2"><span style="color:gray;">,
        </span>mg<span style="color:gray;">.</span>ideal_memory_kb </font><font size="2"><span style="color:gray;">,
        </span>mg<span style="color:gray;">.</span>request_time </font><font size="2"><span style="color:gray;">,
        </span>mg<span style="color:gray;">.</span>grant_time </font><font size="2"><span style="color:gray;">,
        </span>mg<span style="color:gray;">.</span>query_cost </font><font size="2"><span style="color:gray;">,
        </span>mg<span style="color:gray;">.</span>dop </font><font size="2"><span style="color:gray;">,
        </span>st<span style="color:gray;">.</span>[text]
<span style="color:blue;">FROM    </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_query_memory_grants </span><span style="color:blue;">AS </span>mg
        <span style="color:gray;">CROSS APPLY </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_exec_sql_text</span><span style="color:gray;">(</span>plan_handle<span style="color:gray;">) </span><span style="color:blue;">AS </span>st
<span style="color:blue;">WHERE   </span>mg<span style="color:gray;">.</span>request_time <span style="color:gray;">&lt; </span><span style="color:magenta;">COALESCE</span><span style="color:gray;">(</span>grant_time<span style="color:gray;">, </span><span style="color:red;">'99991231'</span></font><font size="2"><span style="color:gray;">)
</span><span style="color:blue;">ORDER BY </span>mg<span style="color:gray;">.</span>requested_memory_kb <span style="color:blue;">DESC </span><span style="color:gray;">;</span></font></pre>
<p><font size="2"><u>Note:</u> This query can be used when there are active sessions waiting on memory to be granted and they are waiting. These sessions will have a wait_type of RESOURCE_SEMAPHORE. You can calculate the wait time for memory grant, by subtracting request_time and grant_time</font></p>
<hr />
<pre class="code"><font size="2"><span style="color:green;">-- SQL Server 2005/2008/R2 version
-- Top clerks ordered by memory used
</span><span style="color:blue;">SELECT TOP</span><span style="color:gray;">(</span>20<span style="color:gray;">) </span>[type] <span style="color:blue;">as </span>[Memory Clerk Name]<span style="color:gray;">, </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span>single_pages_kb<span style="color:gray;">) </span><span style="color:blue;">AS </span>[SPA Memory (KB)]</font><font size="2"><span style="color:gray;">,
</span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span>single_pages_kb<span style="color:gray;">)/</span>1024 <span style="color:blue;">AS </span>[SPA Memory (MB)]
<span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span></font><font size="2"><span style="color:green;">dm_os_memory_clerks
</span><span style="color:blue;">GROUP BY </span>[type]
<span style="color:blue;">ORDER BY </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span>single_pages_kb<span style="color:gray;">) </span><span style="color:blue;">DESC</span><span style="color:gray;">;</span></font></pre>
<pre class="code"><font size="2"><span style="color:green;">-- SQL Server 2012 version
-- Top clerks ordered by memory used
</span><span style="color:blue;">SELECT TOP</span><span style="color:gray;">(</span>20<span style="color:gray;">) </span>[type] <span style="color:blue;">as </span>[Memory Clerk Name]<span style="color:gray;">, </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span>pages_kb<span style="color:gray;">) </span><span style="color:blue;">AS </span>[SPA Memory (KB)]</font><font size="2"><span style="color:gray;">,
</span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span>pages_kb<span style="color:gray;">)/</span>1024 <span style="color:blue;">AS </span>[SPA Memory (MB)]
<span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span></font><font size="2"><span style="color:green;">dm_os_memory_clerks
</span><span style="color:blue;">GROUP BY </span>[type]
<span style="color:blue;">ORDER BY </span><span style="color:magenta;">SUM</span><span style="color:gray;">(</span>pages_kb<span style="color:gray;">) </span><span style="color:blue;">DESC</span></font><span style="color:gray;"><font size="2">;</font>

</span></pre>
<p><font size="2"><strong><u>Output</u></strong></font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image9.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb9.png?w=472&#038;h=118" width="472" height="118" /></a></p>
<p><font size="2"></p>
<p>
    <br />That’s all for now folks!</p>
<p>- TheSQLDude (Sudarshan)</p>
<p></font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/701/'>701</a>, <a href='http://thesqldude.com/tag/buffer-pool/'>buffer pool</a>, <a href='http://thesqldude.com/tag/dmv/'>dmv</a>, <a href='http://thesqldude.com/tag/memory-usage/'>memory usage</a>, <a href='http://thesqldude.com/tag/monitoring/'>monitoring</a>, <a href='http://thesqldude.com/tag/oom/'>OOM</a>, <a href='http://thesqldude.com/tag/out-of-memory/'>out of memory</a>, <a href='http://thesqldude.com/tag/script/'>script</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=418&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/12/14/scripts-to-monitor-sql-server-memory-usage-in-buffer-pool-plan-cache-and-identify-query-memory-grants-waits-by-session/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Service Pack or Update for SQL Server 2008/R2/2012 fails without generating the setup log files!</title>
		<link>http://thesqldude.com/2012/12/12/service-pack-or-update-for-sql-server-2008r22012-fails-without-generating-the-setup-log-files/</link>
		<comments>http://thesqldude.com/2012/12/12/service-pack-or-update-for-sql-server-2008r22012-fails-without-generating-the-setup-log-files/#comments</comments>
		<pubDate>Wed, 12 Dec 2012 18:11:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Setup]]></category>
		<category><![CDATA[bootstrap log]]></category>
		<category><![CDATA[failed]]></category>
		<category><![CDATA[MSI Error 1622]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[ProgramFilesDir]]></category>
		<category><![CDATA[shared features]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=407</guid>
		<description><![CDATA[I was recently working on an interesting setup issue with one of our Premier customers. The scenario was this – they were trying to patch their SQL Server 2008 R2 instance with SP1 (KB 2528583) and it was failing, but the log files were not getting generated fully. In fact, the path C:\Program Files\Microsoft SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=407&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">I was recently working on an interesting setup issue with one of our Premier customers. The scenario was this – they were trying to patch their SQL Server 2008 R2 instance with SP1 (KB 2528583) and it was failing, but the log files were not getting generated fully. In fact, the path C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\log\ did not even have a folder with the latest timestamp. Interestingly, the log files were getting created on the D: drive location <strong><font style="background-color:#ffff00;">D:\</font></strong>Program Files\Microsoft SQL Server\100\Setup Bootstrap\log\ </font></p>
<p><font size="2">From D:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\log\ folder we could only find Summary.txt and Detail.txt</font></p>
<p><font size="2"><u><strong>Summary.txt</strong></u></font></p>
<blockquote><p>Overall summary:     <br />&#160; Final result:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; The patch installer has failed to update the following instance: MSSQLSERVER. To determine the reason for failure, review the log files.      <br />&#160; Exit code (Decimal):&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1513770790      <br />&#160; Exit message:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; The patch installer has failed to update the following instance: MSSQLSERVER. To determine the reason for failure, review the log files.      <br />&#160; Start time:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2012-11-18 00:54:46      <br />&#160; End time:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2012-11-18 01:21:23      <br />&#160; Requested action:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Patch</p>
<p>Requested action:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Patch     <br />Log with failure:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font style="background-color:#ffff00;">C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20121118_005431\MSSQLSERVER\SQLSysClrTypes_Cpu64_1.log</font>      <br />Exception help link:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a href="http://go.microsoft.com/fwlink?LinkId=20476&amp;ProdName=Microsoft+SQL+Server&amp;EvtSrc=setup.rll&amp;EvtID=50000&amp;ProdVer=10.50.2500.0">http://go.microsoft.com/fwlink?LinkId=20476&amp;ProdName=Microsoft+SQL+Server&amp;EvtSrc=setup.rll&amp;EvtID=50000&amp;ProdVer=10.50.2500.0</a></p>
</blockquote>
<p><font size="2">Note the highlighted link and that log file were not present at all!</font></p>
<p><font size="2"><strong><u>Detail.txt</u></strong></font></p>
<p><font size="2">Every feature that was trying get patched logs this error –&gt; MSI Error 1622. 1622 stands for ERROR_INSTALL_LOG_FAILURE, which means the setup program is not able to log setup messages to the log file and hence failed.</font></p>
<p><font size="2">Reference: <a title=" http://msdn.microsoft.com/en-us/library/windows/desktop/aa368542(v=vs.85).aspx" href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa368542(v=vs.85).aspx"> http://msdn.microsoft.com/en-us/library/windows/desktop/aa368542(v=vs.85).aspx</a></font></p>
<blockquote><p>2012-11-18 00:56:46 Slp: Target package: &quot;g:\c6d70a3c67aacef9d9eff6019ffaf3\1033_ENU_LP\x64\setup\sqlsupport_msi\SqlSupport.msi&quot;     <br />2012-11-18 00:56:46 Slp: InstallPackage: MsiInstallProduct returned the result code 1622.      <br />2012-11-18 00:56:46 Slp: Watson Bucket 1 </p>
<p>2012-11-18 01:03:00 Slp: Target package: &quot;g:\c6d70a3c67aacef9d9eff6019ffaf3\1033_ENU_LP\x64\setup\x64\sqlncli.msi&quot;     <br />2012-11-18 01:03:00 Slp: InstallPackage: MsiInstallProduct returned the result code 1622.      <br />2012-11-18 01:03:00 Slp: Watson Bucket 5 </p>
</blockquote>
<p><font size="2">I search for the keyword “at microsoft” to find exception stack and I see this error was raised at the end</font></p>
<blockquote><p>2012-11-18 01:21:19 Slp: Result error code: 1622     <br />2012-11-18 01:21:19 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine       <br />2012-11-18 01:21:19 Slp: Sco: Attempting to open registry subkey       <br />2012-11-18 01:21:19 Slp: Sco: Attempting to open registry subkey Software\Microsoft\PCHealth\ErrorReporting\DW\Installed      <br />2012-11-18 01:21:19 Slp: Sco: Attempting to get registry value DW0201      <br />2012-11-18 01:21:21 Slp: Received request to add the following file to Watson reporting: C:\Users\EGP00\AppData\Local\Temp\2\tmpC720.tmp      <br />2012-11-18 01:21:21 Slp: The following is an exception stack listing the exceptions in outermost to innermost order      <br />2012-11-18 01:21:21 Slp: Inner exceptions are being indented      <br />2012-11-18 01:21:21 Slp:       <br />2012-11-18 01:21:21 Slp: Exception type: <font style="background-color:#ffff00;">System.IO.DirectoryNotFoundException</font>      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160; Message:       <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font style="background-color:#ffff00;">Could not find a part of the path &#8216;C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20121118_005431\MSSQLSERVER&#8217;.</font>      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160; Stack:       <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at System.IO.Directory.InternalGetFileDirectoryNames(String path, String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, SearchOption searchOption)      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at System.IO.DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption)      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at Microsoft.SqlServer.Chainer.Infrastructure.WatsonMsiBucket.ExecutePreCabTasks()      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at Microsoft.SqlServer.Chainer.Infrastructure.WatsonService.ReportFailures()      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at Microsoft.SqlServer.Chainer.Setup.Setup.Start()      <br />2012-11-18 01:21:21 Slp:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at Microsoft.SqlServer.Chainer.Setup.Setup.Main()      <br />2012-11-18 01:21:21 Slp: Watson Bucket 17 </p>
</blockquote>
<p><font size="2">The above message is strange since the path clearly exists and some log files are getting created there, but no the one with the failure. From a admin perspective, while this error is being logged, if you look at the setup screen you will see it frozen at this stage (<strong>MsiTimingAction</strong>),</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image2.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;margin:5px;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb2.png?w=598&#038;h=453" width="598" height="453" /></a></p>
<p>&#160;</p>
<p><font size="2">To make progress on this, I decided to troubleshoot the log file generation, and why the log files are created on the D: drive.</font></p>
<p><font size="2">On a Windows system, the Program Files and Program Files (x86) paths are hard-coded and are set as part of the environment for each program. To open the current program files location, one can just go to Run and type in <strong>%programfiles%</strong> and hit enter. When I did this on my customer’s machine, it opened up the D:\Program Files path. Now, we’re getting somewhere.</font></p>
<p><font size="2">These paths are also stored in the registry location <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion</strong>, as shown below.</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image3.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;margin:5px;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb3.png?w=880&#038;h=137" width="880" height="137" /></a></p>
<p><font size="2">On this machine it was pointing to the D: drive and hence the log files were going there. But some of the log files, were expecting this to always be the C:\ location and hence failing. This explains the log file location mystery.</font></p>
<p><font size="2">The solution was fairly simple from here on, since the location of the ProgramFiles cannot be configured and changing it is not supported as per <a title="http://support.microsoft.com/kb/933700" href="http://support.microsoft.com/kb/933700">http://support.microsoft.com/kb/933700</a></font></p>
<p><font size="2">I changed the location back to the default value by editing the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]</font></p>
<p><font size="2">ProgramFilesDir&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; –&gt; C:\Program Files     <br />ProgramFilesDir (x86) –&gt; C:\Program Files (x86)</font></p>
<p><font size="2">You can also make this change for a specific user profile by adding a User Environment Variable called “ProgramFiles” and setting its value to the path of the program files dir.</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image4.png"><img title="image" style="border-top:0;border-right:0;background-image:none;border-bottom:0;padding-top:0;padding-left:0;margin:5px;border-left:0;display:inline;padding-right:0;" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb4.png?w=329&#038;h=370" width="329" height="370" /></a></p>
<p><font size="2">After changing the registry key value, I rebooted for good measure (though I think a logoff and logon should suffice). Now, when I go to Run and do %programfiles% it takes me to the C: drive as expected.</font></p>
<p><font size="2">Re-ran the SP1 for SQL Server and it completed fine without issues and the log files were also getting created in the default path</font></p>
<p><font size="2">Just thought I’d share this issue since its an example of how system misconfiguration or issues outside of SQL can have an impact of setup and patching.</font></p>
<p><font size="2">&#160;</font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/bootstrap-log/'>bootstrap log</a>, <a href='http://thesqldude.com/tag/failed/'>failed</a>, <a href='http://thesqldude.com/tag/msi-error-1622/'>MSI Error 1622</a>, <a href='http://thesqldude.com/tag/path/'>path</a>, <a href='http://thesqldude.com/tag/programfilesdir/'>ProgramFilesDir</a>, <a href='http://thesqldude.com/tag/shared-features/'>shared features</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=407&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/12/12/service-pack-or-update-for-sql-server-2008r22012-fails-without-generating-the-setup-log-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server 2012 Configuration Manager WMI Error &#8211; Remote Procedure call failed [0x800706be]</title>
		<link>http://thesqldude.com/2012/12/05/sql-server-2012-configuration-manager-wmi-error-remote-procedure-call-failed-0x800706be/</link>
		<comments>http://thesqldude.com/2012/12/05/sql-server-2012-configuration-manager-wmi-error-remote-procedure-call-failed-0x800706be/#comments</comments>
		<pubDate>Wed, 05 Dec 2012 18:07:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[configuration manager]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[RPC failed]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSCM]]></category>
		<category><![CDATA[WMI]]></category>
		<category><![CDATA[wmiprvse.exe]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=400</guid>
		<description><![CDATA[I recently installed SQL 2008 R2 alongside my existing SQL Server 2012 instance. I wanted to change the service account for the SQL Agent service, so I opened SQL Server Configuration Manager (SSCM). To my surprise, I got this error. Bear in mind, this is a freshly installed OS and SQL combination. Error Text: The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=400&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">I recently installed SQL 2008 R2 alongside my existing SQL Server 2012 instance. I wanted to change the service account for the SQL Agent service, so I opened SQL Server Configuration Manager (SSCM). To my surprise, I got this error. Bear in mind, this is a freshly installed OS and SQL combination.</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image.png"><img style="background-image:none;border-bottom:0;border-left:0;margin:5px;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb.png?w=800&#038;h=242" width="800" height="242" /></a></p>
<p><font color="#ff0000" size="2"><font color="#000000">Error Text:</font> The remote procedure call failed. [0x800706be]</font></p>
<p><font color="#000000" size="2">Considering this to a WMI error, I recompiled the MOF file –&gt; mofcomp.exe &quot;C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof&quot;</font></p>
<p><font color="#000000" size="2">I even un-registered and re-registered the sql provider DLL –&gt; regsvr32 &quot;C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmprovider.dll&quot;</font></p>
<p><font color="#000000" size="2">But the issue was not resolved. This was working before and all I did was to install another instance of SQL 2008 R2 which went fine without any issues.</font></p>
<p><font color="#000000" size="2">Next, I used <strong>wbemtest</strong> utility to connect to the SQL namespace and query the list of SQL Service. I was able to connect to the namespace <em><strong>root\microsoft\sqlserver\computermanagement10</strong></em>, but the query “select * from SqlService” returned this error</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/12/image1.png"><img style="background-image:none;border-bottom:0;border-left:0;margin:5px;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/12/image_thumb1.png?w=477&#038;h=389" width="477" height="389" /></a></p>
<p><font size="2">Basically, this was the same error as before. Interestingly, I could connect to the SQL 2012 namespace <strong><em>root\microsoft\sqlserver\computermanagement11,</em></strong> and the query to list the SQL Services worked as well. I checked the application event log and found this “Application Error” Event ID 1000. This tells me that the wmiprvse.exe (WMI host process) is crashing due to an issue with <font style="background-color:#ffffff;">svrenumapi100.dll</font>. This is the DLL that SQL Server uses to perform discovery of services.</font></p>
<blockquote><p>Log Name:&#160;&#160;&#160;&#160;&#160; Application     <br />Source:&#160;&#160;&#160;&#160;&#160;&#160;&#160; Application Error      <br />Date:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 12/5/2012 10:49:28 PM      <br />Event ID:&#160;&#160;&#160;&#160;&#160; 1000      <br />Task Category: (100)      <br />Level:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Error      <br />Keywords:&#160;&#160;&#160;&#160;&#160; Classic      <br />User:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; N/A      <br />Computer:&#160;&#160;&#160;&#160;&#160; XYZ.domain.com      <br />Description:      <br />Faulting application name: wmiprvse.exe, version: 6.2.9200.16384, time stamp: 0x5010ad15      <br />Faulting module name: svrenumapi100.dll, version: 2009.100.1600.1, time stamp: 0x4bb681be      <br />Exception code: 0xc0000005      <br />Fault offset: 0x00000000000514e6      <br />Faulting process id: 0&#215;1458      <br />Faulting application start time: 0x01cdd30cad78774b      <br />Faulting application path: C:\windows\system32\wbem\wmiprvse.exe      <br />Faulting module path: C:\Program Files\Microsoft SQL Server\100\Shared\<font style="background-color:#ffff00;">svrenumapi100.dll</font></p>
<p>Log Name:&#160;&#160;&#160;&#160;&#160; Application     <br />Source:&#160;&#160;&#160;&#160;&#160;&#160;&#160; Windows Error Reporting      <br />Date:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 12/5/2012 10:44:58 PM      <br />Event ID:&#160;&#160;&#160;&#160;&#160; 1001      <br />Task Category: None      <br />Level:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Information      <br />Keywords:&#160;&#160;&#160;&#160;&#160; Classic      <br />User:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; N/A      <br />Computer:&#160;&#160;&#160;&#160;&#160; <strike>XYZ.domain.com</strike>      <br />Description:      <br />Fault bucket -1203304158, type 1      <br />Event Name: APPCRASH      <br />Response: Not available      <br />Cab Id: 0</p>
<p>Problem signature:     <br />P1: <font style="background-color:#ffff00;">wmiprvse.exe</font>      <br />P2: 6.2.9200.16384      <br />P3: 5010af6d      <br />P4: svrenumapi100.dll      <br />P5: 2009.100.1600.1      <br />P6: 4bb682e9      <br />P7: c0000005      <br />P8: 0003a0bf      <br />P9:       <br />P10: </p>
<p>Attached files:     <br />C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\WER18A9.tmp.appcompat.txt      <br />C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\WER18C9.tmp.WERInternalMetadata.xml      <br />C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\WER18CA.tmp.hdmp      <br />C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\WER18FA.tmp.dmp</p>
<p>These files may be available here:     <br />C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_wmiprvse.exe_caa0d63711bd20d668bdb425a1333d9b5156bed4_17011eb4      </p>
</blockquote>
<p> <font size="2">
<p></p>
<p> </font>
<p><strong><u><font size="3"></font></u></strong></p>
<p><strong><u><font size="3">Solution</font></u></strong></p>
<p><font size="2">If you have SQL Server 2012 running side-by-side on the same machine with SQL Server 2008/2008 R2, then you <u><strong>need</strong></u> to have SQL Server 2008 SP3 or later (or) SQL Server 2008 R2 SP1 or later. This is required to obtain the edition information when performing a SQL Server discovery across the enterprise. I applied SP2 on my SQL 2008 R2 instance and that fixed the issue with configuration manager. If you run into this issue, this piece of information might help you.</font></p>
<p><font size="2">-TheSQLDude</font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/configuration-manager/'>configuration manager</a>, <a href='http://thesqldude.com/tag/namespace/'>namespace</a>, <a href='http://thesqldude.com/tag/rpc-failed/'>RPC failed</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/sscm/'>SSCM</a>, <a href='http://thesqldude.com/tag/wmi/'>WMI</a>, <a href='http://thesqldude.com/tag/wmiprvse-exe/'>wmiprvse.exe</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=400&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/12/05/sql-server-2012-configuration-manager-wmi-error-remote-procedure-call-failed-0x800706be/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/12/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Database takes long time to Recover during startup/Restore &#8211; List of Known issues &amp; Fixes</title>
		<link>http://thesqldude.com/2012/10/25/database-takes-long-time-to-recover-during-startuprestore-list-of-known-issues-fixes/</link>
		<comments>http://thesqldude.com/2012/10/25/database-takes-long-time-to-recover-during-startuprestore-list-of-known-issues-fixes/#comments</comments>
		<pubDate>Wed, 24 Oct 2012 19:13:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Startup & Recovery]]></category>
		<category><![CDATA[Storage Engine]]></category>
		<category><![CDATA[dbcc loginfo]]></category>
		<category><![CDATA[In Recovery]]></category>
		<category><![CDATA[recovery]]></category>
		<category><![CDATA[shrinkfile]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[thesqldude]]></category>
		<category><![CDATA[TLOG]]></category>
		<category><![CDATA[VLF]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=392</guid>
		<description><![CDATA[Have you ever wondered why a database takes a long time to recover during start-up or when you performed a restore operation? Recovery is a regular part of Database start-up as SQL server has to go through various phases like Analysis, Redo and Undo to bring the database online in a consistent state. But, sometimes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=392&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">Have you ever wondered why a database takes a long time to recover during start-up or when you performed a restore operation? Recovery is a regular part of Database start-up as SQL server has to go through various phases like Analysis, Redo and Undo to bring the database online in a consistent state. But, sometimes you might notice that recovery is taking an awfully long time, which is preventing the DB from coming online and is inaccessible to your users. From SSMS you will notice the DB is showing up as “In Recovery” or “Recovering”. If anyone tries to use the database, you will get this error.</font></p>
<blockquote><p><font color="#ff0000" size="2">Msg 922, Level 14, State 1, Line 1        <br />Database ‘MyDB1’ is being recovered. Waiting until recovery is finished.</font></p>
</blockquote>
<p><font size="2">Once a DB is in recovery, there is pretty much nothing you can do to make it go faster. <em>Read the troubleshooting section below if your database is already in the recovery phase.</em>      </p>
<p></font><font size="3"><strong>The SQL Errorlogs will tell you the following information:-</strong></font></p>
<ol>
<li><font size="2">The current phase of the DB Recovery process.</font></li>
<li><font size="2">The % completed in the current phase.</font></li>
<li><font size="2">Approximate time remaining before it completes this phase.</font></li>
<li><font size="2">Starting with SQL Server 2008 R2 SP2 and SQL Server 2012 RTM, you will also see the following message if the DB recovery is slow due to large number of Virtual Log Files (VLF’s) present in the transaction log of the database.</font></li>
</ol>
<blockquote><p><font color="#ff0000" size="2">Database MyDB1 has more than 1000 virtual log files which is excessive. Too many virtual log files can cause long startup and backup times. Consider shrinking the log and using a different growth increment to reduce the number of virtual log files.</font> </p>
</blockquote>
<p><strong><font size="3">When does a database go into a recovery phase?</font></strong></p>
<ol>
<li><font size="2">During SQL Server start/restart and when the database initializes</font></li>
<li><font size="2">When you restore a database from a backup.</font></li>
<li><font size="2">When you attach a database.</font></li>
<li><font size="2">When you have the AUTO_CLOSE property turned ON and the database was shutdown because no users were connected. The next time a connection to this database comes in it will enter the recovery phase (usually this should be very fast, since it would have been cleanly shutdown and recovery shouldn’t have any work to do).</font></li>
</ol>
<p><font size="2">There are many known issues with slow database recovery. If you are facing a slow database start-up or recovery issue, first check the following table to ensure your SQL Server build is equal to or greater than the builds mentioned below (depending on the version of your SQL Server instance). </font></p>
<p><font color="#000000" size="3"><strong><u>         <br />Known Issues Section</u></strong></font></p>
<p><b><u><span style="background-image:none;line-height:14pt;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font face="Calibri"><font style="background-color:#ffff00;font-size:12pt;" color="#000000">SQL Server 2005</font></font></span></u></b><b><u><span style="line-height:14pt;"></span></u></b></p>
<table style="border-bottom:medium none;border-left:medium none;border-collapse:collapse;border-top:medium none;border-right:medium none;" class="MsoTableLightListAccent3" border="1" cellspacing="0" cellpadding="0" width="980">
<tbody>
<tr style="height:16.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="75">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">KB Article</font></font></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="529">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">Description</font></font></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="374">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">Fix Build</font></font></span></b><b><span></span></b></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2455009"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2455009</u></font></span></a></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="529">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Slow performance when you recover a database if there are many VLFs inside the transaction log in SQL Server 2005, in SQL Server 2008 or in SQL Server 2008 R2</font></span><span></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="374">
<p style="line-height:normal;margin:0 0 12pt;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 13 for SQL Server 2005 Service Pack 3 </font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(9.00.4315)</font></span></b></p>
<p style="line-height:normal;margin:0 0 12pt;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 1 for SQL Server 2005 Service Pack 4 </font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(9.00.5254)</font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/979042"><span><font style="font-size:8.5pt;" color="#0000ff"><u>979042</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="529">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: The principal database is not recovered if the database has a large number of virtual log files in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="374">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 8 for SQL Server 2005 Service Pack 3 </font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(9.00.4285)</font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/974777"><span><font style="font-size:8.5pt;" color="#0000ff"><u>974777</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="529">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Database restore operation may fail during the recovery phase when the database uses query notification in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="374">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 6 for SQL Server 2005 Service Pack 3&#160; </font></font></span><b><span><font color="#ff0000"><font style="font-size:8.5pt;">(9.00.4266)</font></font></span></b><span></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">&#160;</font></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/975089"><span><font style="font-size:8.5pt;" color="#0000ff"><u>975089</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="529">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: The restore operation takes a long time when you restore a database that has query notification enabled in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="374">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 6 for SQL Server 2005 Service Pack 3&#160; </font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(9.00.4266)</font></span></b><span></span></p>
</td>
</tr>
</tbody>
</table>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><font style="font-size:11pt;" color="#000000">&#160;</font></font></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><b><u><span style="background-image:none;line-height:14pt;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font face="Calibri"><font style="background-color:#ffff00;font-size:12pt;" color="#000000">SQL Server 2008</font></font></span></u></b><b><u><span style="line-height:14pt;"></span></u></b></p>
<table style="border-bottom:medium none;border-left:medium none;border-collapse:collapse;border-top:medium none;border-right:medium none;" class="MsoTableLightListAccent3" border="1" cellspacing="0" cellpadding="0" width="980">
<tbody>
<tr style="height:16.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="75">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">KB Article</font></font></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="531">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">Description</font></font></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="372">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">Fix Build</font></font></span></b><b><span></span></b></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2455009"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2455009</u></font></span></a></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Slow performance when you recover a database if there are many VLFs inside the transaction log in SQL Server 2005, in SQL Server 2008 or in SQL Server 2008 R2</font></span><span></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="372">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 12 for SQL Server 2008 Service Pack 1&#160;&#160;&#160; </font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.2808)</font>                </p>
<p></span></b></p>
<p>         <span></span>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 2 for SQL Server 2008 Service Pack 2 </font></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><span><font color="#333333"><font style="font-size:8.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.4272)</font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2524743"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2524743</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Recovery takes longer than expected for a database in a SQL Server 2008 or in a SQL Server 2008 R2 environment</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="372">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 15 for SQL Server 2008 Service Pack 1 <span>&#160;&#160; </span></font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.2847)</font>                </p>
<p></span></b></p>
<p>         <span></span>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 5 for SQL Server 2008 Service Pack 2 </font></span><span><font color="#333333"><span><font style="font-size:8.5pt;">&#160;&#160; </font></span></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.4316)</font>                </p>
<p></span></b></p>
<p>         <span></span>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 1 for SQL Server 2008 Service Pack 3&#160;&#160;&#160; </font></span><b><span><font color="#ff0000"><font style="font-size:8.5pt;">(10.00.5766)</font></font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2653893"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2653893</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: It takes a long time to restore a database in SQL Server 2008 R2 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="372">
<p style="line-height:normal;margin:0 0 12pt;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 8 for SQL Server 2008 Service Pack 2<span>&#160;&#160;&#160; </span></font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.4326)</font></span></b><span></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 3 for SQL Server 2008 Service Pack 3&#160;&#160;&#160; </font></font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.5770)</font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/979042"><span><font style="font-size:8.5pt;" color="#0000ff"><u>979042</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: The principal database is not recovered if the database has a large number of virtual log files in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="372">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 10 for SQL Server 2008 </font><span><font style="font-size:8.5pt;">&#160; </font></span></font></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><span><font color="#333333"><font style="font-size:8.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.1835)</font>                </p>
<p></span></b></p>
<p>         <span></span>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 7 for SQL Server 2008 Service Pack 1&#160; </font></span><span><span><font color="#333333"><font style="font-size:8.5pt;">&#160; </font></font></span></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.2766)</font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/974777"><span><font style="font-size:8.5pt;" color="#0000ff"><u>974777</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Database restore operation may fail during the recovery phase when the database uses query notification in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="372">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 8 for SQL Server 2008 </font></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><span><font color="#333333"><font style="font-size:8.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.1823)</font></span></b></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font face="Times New Roman"><font style="font-size:12pt;" color="#000000">&#160;</font></font></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 5 for SQL Server 2008 Service Pack 1&#160; </font></span><span><span><font color="#333333"><font style="font-size:8.5pt;">&#160;</font></font></span></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.2746)</font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/975089"><span><font style="font-size:8.5pt;" color="#0000ff"><u>975089</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: The restore operation takes a long time when you restore a database that has query notification enabled in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="372">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 8 for SQL Server 2008</font></font><font style="font-size:8.5pt;">               <br /></font></span><b><span><font style="font-size:8.5pt;"><font color="#ff0000"><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>(10.00.1823)</font></font></span></b></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font face="Times New Roman"><font style="font-size:12pt;" color="#000000">&#160;</font></font></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 5 for SQL Server 2008 Service Pack 1&#160;&#160; </font></span><b><span><font style="font-size:8.5pt;" color="#ff0000">(10.00.2746)</font></span></b><span></span></p>
</td>
</tr>
</tbody>
</table>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><font style="font-size:11pt;" color="#000000">&#160;</font></font></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><b><u><span style="background-image:none;line-height:14pt;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font face="Calibri"><font style="background-color:#ffff00;font-size:12pt;" color="#000000">SQL Server 2008 R2</font></font></span></u></b><b><u><span style="line-height:14pt;"></span></u></b></p>
<table style="border-bottom:medium none;border-left:medium none;border-collapse:collapse;border-top:medium none;border-right:medium none;" class="MsoTableLightListAccent3" border="1" cellspacing="0" cellpadding="0" width="981">
<tbody>
<tr style="height:16.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="75">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">KB Article</font></font></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="531">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">Description</font></font></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;background:#9bbb59;border-top:windowtext 1pt solid;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="22" width="373">
<p style="line-height:normal;text-indent:10.05pt;margin:0;" class="MsoNormal" align="center"><b><span><font face="Calibri"><font style="font-size:10pt;" color="#000000">Fix Build</font></font></span></b><b><span></span></b></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2455009"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2455009</u></font></span></a></span></b><b><span></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Slow performance when you recover a database if there are many VLFs inside the transaction log in SQL Server 2005, in SQL Server 2008 or in SQL Server 2008 R2</font></span><span></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="373">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative Update package 6 for SQL Server 2008 R2</font></font><font style="font-size:8.5pt;">               <br /></font></span><b><span><font style="font-size:8.5pt;"><font color="#ff0000"><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>(10.50.1765)</font></font></span></b></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2524743"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2524743</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: Recovery takes longer than expected for a database in a SQL Server 2008 or in a SQL Server 2008 R2 environment</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="373">
<p style="line-height:normal;margin:0 0 12pt;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative Update package 9 for SQL Server 2008 R2 </font></font></span><b><span><font style="font-size:8.5pt;">                 <br /><font color="#ff0000"><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>(10.50.1804)</font></font></span></b></p>
<p style="line-height:normal;margin:0 0 12pt;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative Update package 2 for SQL Server 2008 R2 Service Pack 1                 <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span><b><span><font style="font-size:8.5pt;"><font color="#ff0000">(10.50.2772)</font></font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/2653893"><span><font style="font-size:8.5pt;" color="#0000ff"><u>2653893</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: It takes a long time to restore a database in SQL Server 2008 R2 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="373">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative update package 11 for SQL Server 2008 R2</font></font><font style="font-size:8.5pt;">               <br /></font></span><b><span><font style="font-size:8.5pt;"><font color="#ff0000"><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>(10.50.1809)</font></font></span></b></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">&#160;</font></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">Cumulative update package 4 for SQL Server 2008 R2 SP1</font></span><span></span></p>
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><font color="#ff0000"><span><font style="font-size:8.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size:8.5pt;"><span>&#160; </span>(10.50.2796)</font></font></span></b><span></span></p>
</td>
</tr>
<tr style="height:43.5pt;">
<td style="border-bottom:windowtext 1pt solid;border-left:windowtext 1pt solid;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="75" nowrap="nowrap">
<p style="line-height:normal;margin:0;" class="MsoNormal"><b><span><a href="http://support.microsoft.com/kb/979042"><span><font style="font-size:8.5pt;" color="#0000ff"><u>979042</u></font></span></a></span></b></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="531">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font style="font-size:8.5pt;" color="#333333">FIX: The principal database is not recovered if the database has a large number of virtual log files in SQL Server 2005 or in SQL Server 2008</font></span></p>
</td>
<td style="border-bottom:windowtext 1pt solid;border-left:medium none;border-top:medium none;border-right:windowtext 1pt solid;padding:0 5.4pt;" height="58" width="373">
<p style="line-height:normal;margin:0;" class="MsoNormal"><span><font color="#333333"><font style="font-size:8.5pt;">Cumulative Update package 1 for SQL Server 2008 R2</font></font><font style="font-size:8.5pt;">               <br /></font></span><b><span><font style="font-size:8.5pt;"><font color="#ff0000"><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>(10.50.1702)</font></font></span></b></p>
</td>
</tr>
</tbody>
</table>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><font style="font-size:11pt;" color="#000000">&#160;</font></font></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><font color="#000000" size="2"><strong></strong></font></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><font color="#000000" size="3"><strong><u>Sample information in the error log about DB recovery</u></strong></font></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><b><span><font color="#333333"><font style="font-size:8.5pt;">Pre-Recovery           <br /></font></font></span></b><font style="font-size:8.5pt;"><span><font color="#333333">The last message you will see for that database (while in recovery) in the log:</font>        <br /></span><span><font color="#c00000">2012-06-26 <span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font style="background-color:#ffff00;">10:29:20.48 </font></span>spid58 Starting up database &#8216;MyDB1&#8242;.</font></span><span>       </p>
<p><font color="#333333">Once the pre-recovery has completed, you will see the following message. In this example, it took almost 9 minutes before the following message appeared.</font>        <br /></span></font><span><font style="font-size:8.5pt;" color="#c00000">2012-06-26 <span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font style="background-color:#99cc00;">10:38:23.25 </font></span>spid58s Analysis of database &#8216;MyDB1&#8242; (7) is 37% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.</font></span></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><span></span><b><span><font style="font-size:8.5pt;" color="#333333">         <br />Phase 1: Analysis           <br /></font></span></b><span><font style="font-size:8.5pt;" color="#c00000">2012-06-26 10:58:15.84 spid58s Analysis of database &#8216;MyDB1&#8242; (7) is <span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font style="background-color:#ffff00;">0% complete</font></span> (approximately 26933 seconds remain). This is an informational message only. No user action is required.        <br /></font></span><span><font style="font-size:8.5pt;" color="#c00000">2010-06-26 17:58:10.70 spid58s Analysis of database &#8216;MyDB1&#8242; (7) is <span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font style="background-color:#ffff00;">100% complete</font></span> (approximately 0 seconds remain). This is an informational message only. No user action is required.</font></span><span>     <br /></span><b><span><font style="font-size:8.5pt;" color="#333333"></font></span></b></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><b><span><font style="font-size:8.5pt;" color="#333333">Phase 2: Redo         <br /></font></span></b><span><font style="font-size:8.5pt;" color="#c00000">2012-06-26 17:59:40.16 spid58s Recovery of database &#8216;MyDB1&#8242; (7) is 1% complete (approximately 1508718 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.</font></span><span>     <br /></span><span><font style="font-size:8.5pt;" color="#c00000">2012-06-26 18:00:40.17 spid58s Recovery of database &#8216;MyDB1&#8242; (7) is 1% complete (approximately <span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;"><font style="background-color:#ffff00;">1508698</font></span> seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.</font></span><span><font face="Times New Roman"><font style="font-size:12pt;" color="#000000">&#160;</font></font></span></p>
<p> <span><font color="#000000" size="3" face="Times New Roman">
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"></p>
<p>   </font><b><span><font style="font-size:8.5pt;" color="#333333">Phase 3: Undo         <br /></font></span></b><span><font style="font-size:8.5pt;" color="#c00000">2012-06-26 21:33:41.12 spid58s Recovery of database &#8216;MyDB1&#8242; (7) is 7% complete        <br /></font></span></span>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><span><font color="#000000" size="2">Starting with SQL Server 2008, the error log also prints summary info about time spent in each phase of the recovery.       <br /></font></span><span><font style="font-size:8.5pt;" color="#c00000">2012-06-27 12:21:48.29 spid7s Recovery completed for database MYDB1 (database ID 7) in 1 second(s) (<font style="background-color:#ffff00;"><span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;">analysis 460 ms, redo 0 ms, undo 591 ms.</span><span style="background-image:none;background-attachment:scroll;background-repeat:repeat;background-position:0 0;">)</span></font> This is an informational message only. No user action is required.</font></span></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><span><font color="#c00000"></font></span></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><span><font color="#c00000"><strong><font color="#000000" size="3"><u>Troubleshooting Information</u></font></strong></font></span></p>
<p style="line-height:13pt;margin:0 0 10pt;" class="MsoNormal"><span><font color="#c00000"><font color="#000000" size="2">I’m not going to re-invent the wheel since this topic has been covered already by folks in the SQL community. You can refer to the following blog posts that explain how to troubleshoot&#160; this issue using DMV’s as well as steps to reduce the VLF’s by shrinking the TLOG file.</font></font>
<ol>
<li style="margin:0;color:#333333;" class="MsoNormal"><span style="font-family:&#039;font-size:8.5pt;"><a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Transaction-Log-VLFs-too-many-or-too-few.aspx"><span style="color:#3966bf;"><u><font size="2">http://www.sqlskills.com/BLOGS/KIMBERLY/post/Transaction-Log-VLFs-too-many-or-too-few.aspx</font></u></span></a><font size="2"> </font></span></li>
<li style="margin:0;color:#333333;" class="MsoNormal"><span><a href="http://blogs.msdn.com/b/psssql/archive/2010/12/29/tracking-database-recovery-progress-using-information-from-dmv.aspx"><span style="color:#3966bf;"><u><font size="2">http://blogs.msdn.com/b/psssql/archive/2010/12/29/tracking-database-recovery-progress-using-information-from-dmv.aspx</font></u></span></a></span><font size="2"> </font></li>
<li style="margin:0;color:#333333;" class="MsoNormal"><span style="font-family:&#039;font-size:8.5pt;"><a href="http://blogs.msdn.com/grahamk/archive/2008/05/09/1413-error-when-starting-database-mirroring-how-many-virtual-log-files-is-too-many.aspx"><span style="color:#3966bf;"><u><font size="2">http://blogs.msdn.com/grahamk/archive/2008/05/09/1413-error-when-starting-database-mirroring-how-many-virtual-log-files-is-too-many.aspx</font></u></span></a><font size="2"> </font></span></li>
<li style="margin:0;color:#333333;" class="MsoNormal"><span style="font-family:&#039;font-size:8.5pt;"><a href="http://blogs.msdn.com/psssql/archive/2009/05/21/how-a-log-file-structure-can-affect-database-recovery-time.aspx"><span style="color:#3966bf;"><u><font size="2">http://blogs.msdn.com/psssql/archive/2009/05/21/how-a-log-file-structure-can-affect-database-recovery-time.aspx</font></u></span></a><font size="2"> </font></span></li>
<li style="margin:0;color:#333333;" class="MsoNormal"><span><a href="http://blogs.msdn.com/psssql/archive/2008/09/12/sql-server-2000-2005-2008-recovery-rollback-taking-longer-than-expected.aspx"><span style="color:#3966bf;"><u><font size="2">http://blogs.msdn.com/psssql/archive/2008/09/12/sql-server-2000-2005-2008-recovery-rollback-taking-longer-than-expected.aspx</font></u></span></a></span><font size="2"> </font></li>
</ol>
<p style="margin:0;color:#333333;" class="MsoNormal"><font size="2"></font></p>
<p style="margin:0;color:#333333;" class="MsoNormal"><font size="2">Well, that’s all folks! Staying tuned as always for more SQL’lly stuff.</font></p>
<p style="margin:0;color:#333333;" class="MsoNormal"><font size="2"></font></p>
<p style="margin:0;color:#333333;" class="MsoNormal"><font size="2">- TheSQLDude</font></p>
<p>   </span></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/dbcc-loginfo/'>dbcc loginfo</a>, <a href='http://thesqldude.com/tag/in-recovery/'>In Recovery</a>, <a href='http://thesqldude.com/tag/recovery/'>recovery</a>, <a href='http://thesqldude.com/tag/shrinkfile/'>shrinkfile</a>, <a href='http://thesqldude.com/tag/slow/'>slow</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/startup-2/'>startup</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a>, <a href='http://thesqldude.com/tag/tlog/'>TLOG</a>, <a href='http://thesqldude.com/tag/vlf/'>VLF</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=392&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/10/25/database-takes-long-time-to-recover-during-startuprestore-list-of-known-issues-fixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>
	</item>
		<item>
		<title>Error 15401 when trying to create a new Windows Login</title>
		<link>http://thesqldude.com/2012/10/17/error-15401-when-trying-to-create-a-new-windows-login/</link>
		<comments>http://thesqldude.com/2012/10/17/error-15401-when-trying-to-create-a-new-windows-login/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 20:25:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[create login]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[error creating login]]></category>
		<category><![CDATA[lookupaccountname]]></category>
		<category><![CDATA[Msg 15401]]></category>
		<category><![CDATA[SID]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[trust relationship]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=386</guid>
		<description><![CDATA[I was working on a customer scenario on my Virtual machine recently. I have a Windows 2008 Domain controller and a another member server that runs my SQL 2008 instance (all VM’s running on Hyper-V). When I tried to create a new Windows login from SSMS, I got this well-known error 15401 Error Text Msg [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=386&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">I was working on a customer scenario on my Virtual machine recently. I have a Windows 2008 Domain controller and a another member server that runs my SQL 2008 instance (all VM’s running on Hyper-V). When I tried to create a new Windows login from SSMS, I got this well-known error 15401</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/10/image.png"><img style="background-image:none;border-bottom:0;border-left:0;margin:5px;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/10/image_thumb.png?w=612&#038;h=193" width="612" height="193" /></a></p>
<p><strong><u>Error Text</u></strong>    <br /><font color="#ff0000" size="2">Msg 15401, Level 11, State 1     <br />Windows NT user or group &#8216;DOMAIN\username&#8217; not found. Check the name again.</font></p>
<p><font size="2">There is already a KB article that talks about some of the known scenarios when you could get Error 15401 in SQL Server. None of these matched my scenario.</font></p>
<p><font size="2"><strong>How to troubleshoot error 15401       <br /><a href="http://support.microsoft.com/kb/324321/en-us"><font color="#0000ff">http://support.microsoft.com/kb/324321/en-us</font></a></strong></font></p>
<p><font size="2">     <br />Since these are Virtual Machines running on Hyper-V, I had made sure when I created the VM’s that none of the machine SID’s are duplicates. I had used newSID.exe to ensure that each client machine joined to my DC had a unique machine SID.</font></p>
<p><font size="2">Since I was not able to add a new login, I used <strong>xp_logininfo</strong> to see if I can retrieve</font></p>
<p><font color="#ff0000" size="2">Msg 15404, Level 16, State 11, Procedure xp_logininfo, Line 62     <br />Could not obtain information about Windows NT group/user &#8216;MyDomain\NewUser&#8217;, <font style="background-color:#ffff00;">error code 0x6fd</font>.</font></p>
<p> <font size="2">
<p>Pay attention to the Windows Error Code 0x6fd that was returned by xp_logininfo.</p>
<p>0x6fd (hex) translates to Win32 error 1789 –&gt; The trust relationship between this workstation and the primary domain failed.</p>
<p>Now, I have only 1 Domain Controller so there are no cross-domain trusts I need to setup etc. If that is your scenario, you might want to check what the trust level between your different domains are. Anyways, in my case that did not apply. So what could be the issue here?</p>
<p>My SQL Server service account was running under a domain account. This account is what SQL Server uses to query AD and retrieve account info when creating a new login. If your SQL Server is running on Windows 7/2008 R2, there is a hotfix that might fix this issue for you –&gt; <a href="http://support.microsoft.com/kb/976494"><font color="#0000ff">http://support.microsoft.com/kb/976494</font></a> </p>
<p>&#160;</p>
<p>To resolve this issue I followed these steps. Please note that this worked for me and might not work for your scenario. I am posting this out just as an FYI in case it helps anyone else encountering a similar scenario.</p>
<p>1. Login to the SQL Server machine and open a command prompt with elevated credentials (Run-As Administrator).</p>
<p>2. Run the following command which will reset the password for the machine account</p>
<blockquote><p><strong>netdom resetpwd /server:&lt;DomainControllerName&gt; /userd:&lt;domain\domainadminuser&gt; /passwordd:&lt;password&gt;         <br /></strong>E.g. <font color="#0000ff">netdom resetpwd /server:CONTOSO-DC /userd:CONTOSO\administrator /passwordd:MyDCPassw0rd</font></p>
</blockquote>
<p><font color="#000000"><em><u>Expected output</u>: The machine account password for the local machine has been successfully reset.</em></font></p>
<p><font color="#000000">3. Restart the Netlogon service on the SQL Server machine.</font></p>
<p><font color="#000000">4. Clear the Kerberos tickets on the SQL Server machine from command prompt</font></p>
<blockquote><p><strong>klist purge</strong></p>
</blockquote>
<p><em><u>Excepted output:</u> Deleting all tickets: Ticket(s) purged!</em></p>
<p><font color="#000000">5. After this was done, I re-ran the xp_logininfo ‘contoso\newlogin’ and this time it completed and did not give error 15401. [<em>I did <u><strong>not</strong></u> restart my SQL Server service</em>]</font></p>
<p><font color="#000000">6. Now, I was able to add the login from SSMS or using CREATE LOGIN.</font></p>
<p><font color="#000000"></font></p>
<p><font color="#000000">A key point here is step #2, the netdom command needs to be run from the machine whose machine account password you want to reset. To reset a machine account password, you need someone with domain admin credentials. So you need a Domain admin credentials as this is required for netdom.exe. In our scenario, the machine has to be the SQL server machine. More information about what netdom.exe does is available in this KB article –&gt; <a href="http://support.microsoft.com/kb/325850"><font color="#0000ff">http://support.microsoft.com/kb/325850</font></a></font></p>
<p><font color="#000000">HTH.       </p>
<p>Regards,        <br />TheSQLDude</font></p>
<p> </font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/create-login/'>create login</a>, <a href='http://thesqldude.com/tag/dns/'>DNS</a>, <a href='http://thesqldude.com/tag/error-creating-login/'>error creating login</a>, <a href='http://thesqldude.com/tag/lookupaccountname/'>lookupaccountname</a>, <a href='http://thesqldude.com/tag/msg-15401/'>Msg 15401</a>, <a href='http://thesqldude.com/tag/sid/'>SID</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/trust-relationship/'>trust relationship</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=386&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/10/17/error-15401-when-trying-to-create-a-new-windows-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/10/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Some known issues with SQL Server Management Studio (SSMS)</title>
		<link>http://thesqldude.com/2012/09/13/some-known-issues-with-sql-server-management-studio-ssms/</link>
		<comments>http://thesqldude.com/2012/09/13/some-known-issues-with-sql-server-management-studio-ssms/#comments</comments>
		<pubDate>Thu, 13 Sep 2012 17:06:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[hang]]></category>
		<category><![CDATA[Management Studio]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[sqlwb]]></category>
		<category><![CDATA[SSMS]]></category>
		<category><![CDATA[ssms.exe]]></category>
		<category><![CDATA[thesqldude]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=382</guid>
		<description><![CDATA[We all use SSMS everyday and it is the main work tool for a DBA/Developer. This post contains info on known issues (bugs) with SQL Server Management Studio. Sharing this in case you are running into any of these known issues, the fix information is given below. Issue 1 IntelliSense feature stops working in SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=382&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">We all use SSMS everyday and it is the main work tool for a DBA/Developer. This post contains info on known issues (bugs) with SQL Server Management Studio. Sharing this in case you are running into any of these known issues, the fix information is given below.</font></p>
<p><font size="2"><strong><u>         <br />Issue 1</u></strong></font></p>
<p><font size="2">IntelliSense feature stops working in SQL Server 2008/R2 Management Studio</font></p>
<p><strong><font size="2">FIX: The IntelliSense feature in SSMS 2008 R2 may stop working after you install Visual Studio 2010 SP1       <br /></font><a title="http://support.microsoft.com/kb/2531482" href="http://support.microsoft.com/kb/2531482"><font color="#0000ff" size="2">http://support.microsoft.com/kb/2531482</font></a></strong></p>
<ul>
<li><font size="2">Install cumulative update 7 for SQL Server 2008 R2 to fix this issue.</font></li>
<li><font size="2">Issue happens if you have installed Visual Studio 2010 SP1 alongside SSMS 2008 R2.</font></li>
</ul>
<p><font size="2"><strong><u>Issue 2</u></strong></font></p>
<p><font size="2">SSMS Hangs on a computer with more than 32 processors. When you click on Connect to Database Engine, the application just hangs and does not connect.</font></p>
<p><font size="2">FIX: An application that is based on the .NET Framework 2.0 stops responding on a computer that has more than 32 processors, and the .NET Framework 2.0 Service Pack 2 or the .NET Framework 3.5 Service Pack 1 is installed     <br /></font><a href="http://support.microsoft.com/kb/2276255"><font color="#0000ff" size="2">http://support.microsoft.com/kb/2276255</font></a></p>
<ul>
<li><font size="2">This is a known issue with .NET 2.0 or .NET 3.5 SP1</font></li>
<li><font size="2">The above KB has fixes for Windows Vista/Server 2008 and above. If your computer is running Windows Server 2003, then you can apply the below hotfix to resolve this issue. This will patch your .NET 2.0 to a higher build than above KB and fix the issue.</font></li>
</ul>
<p><font size="2">KB &#8211;&gt; </font><a href="http://support.microsoft.com/kb/2461007"><font color="#0000ff" size="2">http://support.microsoft.com/kb/2461007</font></a>    <br /><font size="2">Download &#8211;&gt; </font><a href="http://hotfixv4.microsoft.com/.NET%20Framework%202.0%20-%20Windows%20%202000,%20Windows%202003,%20Windows%20XP%20(MSI)/sp2/DevDiv937463/50727.5066/free/425615_intl_x64_zip.exe"><font color="#0000ff" size="2">http://hotfixv4.microsoft.com/.NET%20Framework%202.0%20-%20Windows%20%202000,%20Windows%202003,%20Windows%20XP%20(MSI)/sp2/DevDiv937463/50727.5066/free/425615_intl_x64_zip.exe</font></a></p>
<p>&#160;</p>
<p><font size="2"><strong><u>Issue 3</u></strong></font></p>
<p><font size="2">SQL Server Management Studio take a long time to open</font></p>
<p><font size="2">When running &quot;SQL Server Management Studio&quot; the application may load slowly.     <br /></font><a href="http://support.microsoft.com/kb/555686"><font color="#0000ff" size="2">http://support.microsoft.com/kb/555686</font></a></p>
<ul>
<li><font size="2">This is usually observed if the server/computer is not directly connected to the internet or it could be due to 32-bit SSMS running on 64-bit OS (Refer <a href="http://support.microsoft.com/kb/906892">http://support.microsoft.com/kb/906892</a> )</font></li>
<li><font size="2">The reason for the slow start up of SSMS is during start up, the .NET Runtime tries to contact crl.microsoft.com to ensure that the certificate is valid.</font></li>
<li><font size="2">If the machine isn’t connected to the internet, the connection will eventually time-out (hence the delay)</font></li>
<li><font size="2">The workaround is to disable “Check publisher’s certificate revocation” under Internet Options.</font></li>
</ul>
<p><font size="2"></font></p>
<p><font size="2">There are a few other useful tips given in this blog to speed up SSMS &#8211;&gt; </font><a href="http://eniackb.blogspot.com/2009/06/sql-server-management-studio-slow.html">http://eniackb.blogspot.com/2009/06/sql-server-management-studio-slow.html</a></p>
<p><font size="2">If you know of any other issues, leave a comment behind with the info and I&#8217;ll add it to the blog post. Cheers!</font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/cpu/'>CPU</a>, <a href='http://thesqldude.com/tag/crash/'>crash</a>, <a href='http://thesqldude.com/tag/hang/'>hang</a>, <a href='http://thesqldude.com/tag/management-studio/'>Management Studio</a>, <a href='http://thesqldude.com/tag/slow/'>slow</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/sqlwb/'>sqlwb</a>, <a href='http://thesqldude.com/tag/ssms/'>SSMS</a>, <a href='http://thesqldude.com/tag/ssms-exe/'>ssms.exe</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=382&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/09/13/some-known-issues-with-sql-server-management-studio-ssms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>
	</item>
		<item>
		<title>Identifying Documents &amp; Document Types that are NOT present in the full-text index</title>
		<link>http://thesqldude.com/2012/08/29/identifying-documents-document-types-that-are-not-present-in-the-full-text-index/</link>
		<comments>http://thesqldude.com/2012/08/29/identifying-documents-document-types-that-are-not-present-in-the-full-text-index/#comments</comments>
		<pubDate>Wed, 29 Aug 2012 17:40:00 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[FTS (Full-Text Search)]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[byte]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[document management]]></category>
		<category><![CDATA[documents]]></category>
		<category><![CDATA[failed]]></category>
		<category><![CDATA[fts]]></category>
		<category><![CDATA[fulltext]]></category>
		<category><![CDATA[fulltext index]]></category>
		<category><![CDATA[indexed]]></category>
		<category><![CDATA[population]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[thesqldude]]></category>

		<guid isPermaLink="false">https://thesqldude.wordpress.com/?p=380</guid>
		<description><![CDATA[I recently worked on this scenario with a customer of mine. They had a DOCS table which contained resume’s and CV’s of their candidates. This DOCS table was full-text indexed. They noticed that their search results in the application was not showing all the documents when they performed keyword based search. On looking into the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=380&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><font size="2">I recently worked on this scenario with a customer of mine. They had a DOCS table which contained resume’s and CV’s of their candidates. This DOCS table was full-text indexed. They noticed that their search results in the application was not showing all the documents when they performed keyword based search. On looking into the full-text index and following my previous post on this topic @ <a title="http://thesqldude.com/2012/07/06/how-to-identify-the-row-or-document-that-failed-to-index-during-a-fulltext-index-population/" href="http://thesqldude.com/2012/07/06/how-to-identify-the-row-or-document-that-failed-to-index-during-a-fulltext-index-population/"><font color="#0000ff">http://thesqldude.com/2012/07/06/how-to-identify-the-row-or-document-that-failed-to-index-during-a-fulltext-index-population/</font></a>&#160;</font><font size="2">, we found out that many .DOC and .HTML documents have failed, hence these don’t show up in the search results.</font></p>
<p><font size="2">Now, dbo.DOCS is a huge table and it contained more than a million rows. 1190688 to be exact. So to find out that documents that need to be replaced, I did the following steps.</font></p>
<p><font size="2"><strong><u>GOAL</u></strong></font></p>
<p><font size="2">1. Identify all the document types and the count of documents of that type, which are not a part of the full-text index</font></p>
<p><font size="2">2. Identify each DocumentID that is not a part of full-text index, so that this can be corrected from the application and thus re-index via fulltext population.</font></p>
<p><font size="2"></font></p>
<p><font size="2">Luckily for me this was SQL Server 2008 R2. Starting with SQL Server 2008 there are 2 useful DMV’s that contain information about the full-text index. </font></p>
<blockquote><p><font size="2">a) sys.dm_fts_index_keywords_by_document</font></p>
<p><font size="2">b) sys.dm_fts_index_keywords</font></p>
</blockquote>
<p><font size="2">These views were not present in SQL 2005. Using the DMV <a href="http://technet.microsoft.com/en-us/library/cc280607.aspx" target="_blank"><font color="#0000ff">sys.dm_fts_index_keywords_by_document</font></a> we can get to find the Document that is present in the FTIndex. If a document is present, it means it has been indexed successfully.</font></p>
<p><font size="2"></font></p>
<p><font size="2"><u><strong>Table Structure</strong></u></font></p>
<p><font size="2"><strong>[dbo].[Docs]</strong>      <br />&#160;&#160;&#160; [DocId] [int](50)      <br />&#160;&#160;&#160; [DocName] [varchar](400)      <br />&#160;&#160;&#160; [DocType] [varchar](200)&#160; <br />&#160;&#160;&#160; [DocCategory] [varchar](50)      <br />&#160;&#160;&#160; [Document] [varbinary]</font></p>
<p><font size="2"><strong>sys.dm_fts_index_keywords_by_document</strong>      <br />&#160;&#160;&#160; [document_id]&#160; [int]      <br />&#160;&#160;&#160; [occurrence_count]&#160;&#160; [int]      <br />&#160;&#160;&#160; [display_term]&#160;&#160; [nvarchar (8000)]</font></p>
<p><font size="2">The Document_id column in the DMV corresponds to the full-text key value of the table. In this case the table dbo.Docs has the full-text key column as [DocId]. So, basically the Docs.dbo (DocId) is the same as sys.dm_fts_index_keywords_by_document (document_id). If you want to find the full-text key column of a table, you can use a query like this within the context of the user database.</font></p>
<pre class="code"><font size="2"><span style="color:blue;">SELECT </span><span style="color:magenta;">COL_NAME</span><span style="color:gray;">(</span><span style="color:magenta;">object_Id</span><span style="color:gray;">(</span><span style="color:red;">'dbo.Docs'</span><span style="color:gray;">),</span><span style="color:magenta;">OBJECTPROPERTY</span><span style="color:gray;">(</span><span style="color:magenta;">OBJECT_ID</span><span style="color:gray;">(</span><span style="color:red;">'dbo.Docs'</span><span style="color:gray;">), </span><span style="color:red;">'TableFulltextKeyColumn'</span><span style="color:gray;">))</span></font></pre>
<p><font size="2"></font></p>
<p>&#160;</p>
<p><strong><u><font size="2">Identifying Indexed Documents, Failed Documents and Document Types</font></u></strong></p>
<p><font size="3">1. Find the count of documents that are successfully indexed</font></p>
<pre class="code"><font size="2"><span style="color:blue;">drop table </span>#fts_index_document_id
<span style="color:blue;">CREATE table </span>#fts_index_document_id <span style="color:gray;">(</span>docid <span style="color:blue;">int</span></font><font size="2"><span style="color:gray;">)
</span><span style="color:blue;">insert into </span>#fts_index_document_id
<span style="color:blue;">SELECT distinct </span>document_id <span style="color:blue;">FROM </span><span style="color:green;">sys</span><span style="color:gray;">.</span><span style="color:green;">dm_fts_index_keywords_by_document</span><span style="color:gray;">(</span><span style="color:magenta;">db_id</span><span style="color:gray;">(</span><span style="color:red;">'ContentDB'</span><span style="color:gray;">), </span><span style="color:magenta;">object_id</span><span style="color:gray;">(</span><span style="color:red;">'dbo.Docs'</span></font><span style="color:gray;"><font size="2">))
</font></span><font size="2"><span style="color:blue;">go
select </span><span style="color:magenta;">count</span></font><font size="2"><span style="color:gray;">(*) <span style="color:blue;">as </span>[Successful Document Count] 
</span><span style="color:blue;">from </span>dbo<span style="color:gray;">.</span>docs_tbl_data t1
<span style="color:gray;">join </span>dbo<span style="color:gray;">.</span>fts_index_document_id t2
<span style="color:blue;">on </span>t1<span style="color:gray;">.</span>DocID <span style="color:gray;">= </span>t2<span style="color:gray;">.</span>DocID</font></pre>
<p><font size="2"></font></p>
<p><font size="2">I found that 979415 rows were returned from the above query.<br />
    <br /><strong><font color="#008000">Successfully Indexed Documents = 979415</font></strong> </p>
<p></font></p>
<p><font size="3">2. Find the count of documents that are NOT successfully indexed, i.e. Failed Documents</font></p>
<pre class="code"><font size="2"><span style="color:blue;">select </span><span style="color:magenta;">count</span><span style="color:gray;">(*) </span><span style="color:blue;">as </span>[Failed Document Count]
<span style="color:blue;">from </span>dbo<span style="color:gray;">.D</span>ocs t1
<span style="color:blue;">where </span>t1<span style="color:gray;">.</span>docid <span style="color:gray;">not in ( </span><span style="color:blue;">select </span>t2<span style="color:gray;">.</span>docid <span style="color:blue;">from </span>#fts_index_document_id t2<span style="color:gray;">)</span></font></pre>
<p><font size="2">I found that 211273 rows were returned from the above query, which is basically a NOT IN filter where each document_id present in the base table (dbo.Docs) is checked in the FTindex (#fts_index_document_id) and if not present then it is a failed document.</font></p>
<p><strong><font color="#008000" size="2">Failed to Index Documents = 211273</font></strong></p>
<p><font size="2">Okay, so I did a count of the total rows present in the table dbo.Docs, and that came up to 1190688</font></p>
<p><table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="200"><font size="2">Total Documents</font></td>
<td valign="top" width="200"><font size="2">1190688</font></td>
</tr>
<tr>
<td valign="top" width="200"><font size="2">Successfully Indexed Docs</font></td>
<td valign="top" width="200"><font size="2">979415</font></td>
</tr>
<tr>
<td valign="top" width="200"><font size="2">Failed to Index Docs</font></td>
<td valign="top" width="200"><font size="2">211273</font></td>
</tr>
</tbody>
</table>
<p><font size="2">So, the count is tallying up fine. </font></p>
<p><font size="2"></font></p>
<p><font size="3">3. Find the count of each document type and the number of documents of that type that has failed to be indexed.</font></p>
<p><font size="2">The idea here is basically to see which document types/formats are the ones that have failed to get indexed. You might notice patterns when finding this out, like all PDF docs have failed or something similar. To find out, I used this query</font></p>
<pre class="code"><font size="2"><span style="color:blue;">select </span>DocType<span style="color:gray;">, </span><span style="color:magenta;">COUNT</span><span style="color:gray;">(</span>1<span style="color:gray;">) as [Count] </span><span style="color:blue;">from </span>dbo<span style="color:gray;">.</span>Docs
<span style="color:blue;">where </span>DOCID <span style="color:gray;">NOT IN (</span><span style="color:blue;">select </span>docid <span style="color:blue;">from #</span>fts_index_document_id</font><font size="2"><span style="color:gray;">) 
</span><span style="color:blue;">group by </span>DocType
<span style="color:blue;">order by </span><span style="color:magenta;">COUNT</span><span style="color:gray;">(</span>1<span style="color:gray;">) </span></font><span style="color:blue;"><font size="2">desc
</font></span></pre>
<p><font size="2"></font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/08/image.png"><img style="background-image:none;border-bottom:0;border-left:0;margin:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/08/image_thumb.png?w=149&#038;h=215" width="149" height="215" /></a></p>
<p><font size="2">As we can see from the above output, most of the failed documents are of type HTML and DOC. </font></p>
<p><font size="2"></font></p>
<p><font size="3">4. Find each individual document, document name of a specific document type has failed to be indexed</font></p>
<p><font size="2">Now that we have the breakdown of document types that have failed, we need to identify each unique document in the table of a specific type (say .DOC) that isn’t indexed, so that it can be corrected from the application side by re-inserting the document.</font></p>
<p><font size="2">I am using the same # temp table which contains my indexed documents in the FTIndex. The reason I am using a #tmp table is because the DMV is slow as it scans through the full-text index and we don’t have to read the index each time. So I’m storing the output in a #tmp table and re-using that for all my queries. I would recommend you follow this because if the FTIndex is large, then querying the DMV each time isn’t going to be fast nor good for performance.</font></p>
<pre class="code"><font size="2"><span style="color:blue;">select </span>t3<span style="color:gray;">.</span>DocId<span style="color:gray;">, </span>t3<span style="color:gray;">.</span>Doctype<span style="color:gray;">, </span>t3<span style="color:gray;">.</span>DocName<span style="color:gray;">, </span>t3<span style="color:gray;">.</span>DocCategory
<span style="color:blue;">from </span>dbo<span style="color:gray;">.</span>Docs t3
<span style="color:blue;">where </span>t3<span style="color:gray;">.</span>DocID </font><font size="2"><span style="color:gray;">not in (
</span><span style="color:blue;">select </span>t1<span style="color:gray;">.</span>DocID <span style="color:blue;">from </span>dbo<span style="color:gray;">.</span>Docs t1
<span style="color:gray;">join </span>#fts_index_document_id t2
<span style="color:blue;">on </span>t1<span style="color:gray;">.</span>DocID <span style="color:gray;">= </span>t2<span style="color:gray;">.</span>DocId</font><font size="2"><span style="color:gray;">)
<font>and </font></span><font>t3<span style="color:gray;">.</span>DocType <span style="color:gray;">= </span></font></font><font size="2"><span style="color:red;"><font>'HTML'</font>
</span><span style="color:blue;">order by </span>t3<span style="color:gray;">.</span>DocId <span style="color:blue;">asc</span></font></pre>
<p><font size="2">The output of the above query will return each document that has failed to be indexed (not a part of the full-text index) and of type HTML. You can change the filter clause highlighted to suite your needs. See sample output below for a list of failed documents of type ‘DOC’.</font></p>
<p><a href="http://thesqldude.files.wordpress.com/2012/08/image1.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://thesqldude.files.wordpress.com/2012/08/image_thumb1.png?w=287&#038;h=170" width="287" height="170" /></a></p>
<p><font size="2">Since you now the Document names, Document ID, Document type, you can get in touch with your application team to have a look at these documents and verify these are valid documents. If possible they can be reinserted back from the application into the table dbo.Docs.</font></p>
<p><font size="2"><strong><u>NOTE</u></strong></font></p>
<p><font size="2">The thing with document indexing is that, all of these documents are first stored on the file-system and usually there is an application involved (any document management application) that takes care of inserting these documents into the database as BLOB data (varbinary, text, image). Usually its not inserted directly, but via some application. The application has to programmatically read the document as BYTE or Stream and then pass this to the database insert statement. There are chances that the application code has issues for certain documents, like maybe it missed a BYTE value or header. You will notice this scenario, when a particular document opens up fine using Office Client but the same document does not get indexed with this error</font></p>
<p><font color="#ff0000" size="2"> Error &#8217;0x8004170c: The document format is not recognized by the filter.&#8217; occurred during full-text index population</font></p>
<p><font size="2"></font></p>
<p><font size="2">When you see this error, keep in mind the application that is actually taking the document and inserting it into the database. </font><font size="2">Whichever application is being used to insert the documents is not doing it correctly and the document is actually not valid for indexing. The IFilter for Office Documents is very strict on the file format. It will not even process other file formats that Word is able to open such as RTF. Opening the file with Office Client is very different to opening the stream for the IFilter. You will see this behaviour yourself when you open/save the same file without changes, Office Client adds other changes and filesize increases. It does make changes to the file header and this is a key point!<br />
    <br />&#160; <br />You may want to take a closer look to see how these DOC files are getting inserted into SQL Server. I&#8217;ve seen that even a small byte missed here or there can render the file invalid (in the eyes of the IFilter). I&#8217;ve seen this happen for XLS/PPT/DOC file formats. If you face this scenario, try and find answers to the following questions.</p>
<p><strong><u>Question to Think about:-</u></strong></font></p>
<p><font size="2">1. What is the application used to insert these documents into the database?</font></p>
<blockquote><p><font size="2">Find the application vendor or support team and ask them if they have any application updates or any issues reported of specific documents types failing to get indexed</font></p></blockquote>
<p><font size="2"></p>
<p>2. When were these failed documents inserted. Try and find the source date/year when these were added to the table (maybe a datetime column exists in the table?)</p>
<blockquote>
<p>It is possible that all of the failed documents originated from a specific date and time. Usually this is the case for older file formats like DOC/PPT/XLS compared to the new Metro Office Formats like DOCX etc.</p>
<p>It is also possible that at the time these were inserted, the application performing the insert had some issues which were later fixed<br />
      </p>
</blockquote>
<p></font></p>
<p><font size="2">3. Are there different versions of this application available?</font></p>
<blockquote>
<p><font size="2">Same as #2. If the application has later fixes, it doesn’t change the fact that the table contains BLOB value inserted using an older version of the application. Re-inserting the same documents using the newer version of the application is a step to take. </font></p>
</blockquote>
<p><font size="2">4. Are they facing failure with new documents being inserted today?</font></p>
<blockquote>
<p><font size="2">This will tell you if the issue is with older documents already present in the table or even with newly added documents. Again, we are just narrowing down the source of the problem.</font></p>
<p></p>
</blockquote>
<p><font size="2">&#160;</font></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/byte/'>byte</a>, <a href='http://thesqldude.com/tag/doctype/'>doctype</a>, <a href='http://thesqldude.com/tag/document-management/'>document management</a>, <a href='http://thesqldude.com/tag/documents/'>documents</a>, <a href='http://thesqldude.com/tag/failed/'>failed</a>, <a href='http://thesqldude.com/tag/fts/'>fts</a>, <a href='http://thesqldude.com/tag/fulltext/'>fulltext</a>, <a href='http://thesqldude.com/tag/fulltext-index/'>fulltext index</a>, <a href='http://thesqldude.com/tag/indexed/'>indexed</a>, <a href='http://thesqldude.com/tag/population/'>population</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=380&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/08/29/identifying-documents-document-types-that-are-not-present-in-the-full-text-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/08/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://thesqldude.files.wordpress.com/2012/08/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>User Opinion Poll &#8211; What topic(s) would you like to see posted on TheSQLDude weblog?</title>
		<link>http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/</link>
		<comments>http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/#comments</comments>
		<pubDate>Tue, 10 Jul 2012 16:25:43 +0000</pubDate>
		<dc:creator>Sudarshan Narasimhan</dc:creator>
				<category><![CDATA[Opinion Poll]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[opinion poll]]></category>
		<category><![CDATA[Poll]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[survey]]></category>
		<category><![CDATA[thesqldude]]></category>

		<guid isPermaLink="false">http://thesqldude.com/?p=353</guid>
		<description><![CDATA[WordPress Readers, Friends, Fans, SQLDudes, Romans and Countrymen, Time for an opinion poll @theSQLDude. It&#8217;s been a year since I have had my weblog active and running. While the feedback and comments have been great, it&#8217;s time to take this to the next level. This fiscal year, I&#8217;d like to hear from you (my readers) out there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=353&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h4>WordPress Readers, Friends, Fans, SQLDudes, Romans and Countrymen,</h4>
<p><span style="color:#0000ff;"><em>Time for an opinion poll @theSQLDude. It&#8217;s been a year since I have had my weblog active and running. While the feedback and comments have been great, it&#8217;s time to take this to the next level. This fiscal year, I&#8217;d like to hear from you (my readers) out there and listen to your comments on what topics/features you would like to read and learn about in this weblog. Please feel free to share this poll with your colleagues &amp; friends. It will take a few seconds to finish the poll, so go ahead and exercise your grey cells.</em></span></p>
<p><em>Regards,</em><br />
<strong>Sudarshan a.k.a TheSQLDude</strong></p>
<a name="pd_a_6379812"></a>
<div class="PDS_Poll" id="PDI_container6379812" data-settings="{&quot;url&quot;:&quot;http:\/\/static.polldaddy.com\/p\/6379812.js&quot;}" style="display:inline-block;"></div>
<div id="PD_superContainer"></div>
<noscript><a href="http://polldaddy.com/poll/6379812">Take Our Poll</a></noscript>
<p><strong>.<br />
</strong></p>
<br /> Tagged: <a href='http://thesqldude.com/tag/feedback/'>feedback</a>, <a href='http://thesqldude.com/tag/opinion/'>opinion</a>, <a href='http://thesqldude.com/tag/opinion-poll-2/'>opinion poll</a>, <a href='http://thesqldude.com/tag/poll/'>Poll</a>, <a href='http://thesqldude.com/tag/sql-server/'>SQL Server</a>, <a href='http://thesqldude.com/tag/survey/'>survey</a>, <a href='http://thesqldude.com/tag/thesqldude/'>thesqldude</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thesqldude.com&#038;blog=24981149&#038;post=353&#038;subd=thesqldude&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thesqldude.com/2012/07/10/user-opinion-poll-what-topics-would-you-like-to-see-posted-on-thesqldude-weblog/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/739519cb490eba6022005efab00c51d0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thesearchman</media:title>
		</media:content>
	</item>
	</channel>
</rss>
