<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Clay Lenhart's Blog &#187; SQL Server Administration</title>
	<atom:link href="http://clay.lenharts.net/blog/category/sql-server-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://clay.lenharts.net/blog</link>
	<description>A blog on .Net and SQL Server</description>
	<lastBuildDate>Tue, 31 Oct 2017 10:34:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.2</generator>
	<item>
		<title>Execution Plan of Frequent Queries</title>
		<link>http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/</link>
		<comments>http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/#comments</comments>
		<pubDate>Fri, 29 May 2009 19:03:42 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[dynamic management views]]></category>
		<category><![CDATA[execution plan]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Engine]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=110</guid>
		<description><![CDATA[Bill Galashan, DBA of bet365 sent over the following query that lists the execution plan of the 10 most frequently executed queries. <a href="http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Bill Galashan, DBA of <a href="http://www.bet365.com/">bet365</a> sent over the following query that lists the execution plan of the 10 most frequently executed queries.</p>
<p>He writes:</p>
<blockquote><p>We got into this due to different query plans coming from a VB or a web app than what was seen when running the same query from Management Studio. Eventually tracked this down to a difference in the set options predominatley whether Arithabort was on or off. </p></blockquote>
<p>Read more to see his query.<span id="more-110"></span></p>
<p>Click here to <a href="http://clay.lenharts.net/blog/2008/04/13/cached-execution-plans-in-sql-server/">see the execution plan of currently running queries</a>. </p>
<pre class="brush: sql; title: ; notranslate">
SELECT TOP 10 creation_time, last_execution_time,  last_worker_time / 1000 as [Last Worker Time (ms)] ,min_worker_time / 1000 as [Min Worker Time (ms)], 
      max_worker_time / 1000 as [Max Worker Time (ms)],
    total_worker_time/execution_count/1000 AS [Avg Worker Time (ms)],
    execution_count, 
    SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
    ((CASE statement_end_offset 
        WHEN -1 THEN DATALENGTH(st.text)
        ELSE qs.statement_end_offset 
        END 
            - qs.statement_start_offset)/2) + 1) as statement_text,plan_generation_num ,query_plan, Plan_handle
FROM sys.dm_exec_query_stats as qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle)
-- where st.text like '%proc name to be searched for%'
ORDER BY execution_count DESC;
</pre>
<pre class="brush: sql; title: ; notranslate">
--- Determine options used at run time

select  * from sys.syscacheobjects with (nolock) where sql like '%proc to be searched for%' and objtype='proc'


select dbo.fn_setopts(249)

/*
 This contains a bitmap containing the SET options relevant to each cached plan for a proc.
The following function can be used to decipher this bitmask:
*/

 

create function dbo.fn_setopts(@setopts int)
returns nvarchar(4000)

as
begin

declare @s nvarchar(4000)
select @s='Options: '
if @setopts &amp;amp;amp;amp;amp; 1    &gt; 0 select @s = @s + N'ANSI_PADDING, ' 
if @setopts &amp;amp;amp;amp;amp; 2    &gt; 0 select @s = @s + N'max degree of parallelism, '
if @setopts &amp;amp;amp;amp;amp; 4    &gt; 0 select @s = @s + N'FORCEPLAN, ' 
if @setopts &amp;amp;amp;amp;amp; 8    &gt; 0 select @s = @s + N'CONCAT_NULL_YIELDS_NULL, '
if @setopts &amp;amp;amp;amp;amp; 16   &gt; 0 select @s = @s + N'ANSI_WARNINGS, '
if @setopts &amp;amp;amp;amp;amp; 32   &gt; 0 select @s = @s + N'ANSI_NULLS, '
if @setopts &amp;amp;amp;amp;amp; 64   &gt; 0 select @s = @s + N'QUOTED_IDENTIFIER, '
if @setopts &amp;amp;amp;amp;amp; 128  &gt; 0 select @s = @s + N'ANSI_NULL_DFLT_ON, '
if @setopts &amp;amp;amp;amp;amp; 256  &gt; 0 select @s = @s + N'ANSI_NULL_DFLT_OFF, '
if @setopts &amp;amp;amp;amp;amp; 512  &gt; 0 select @s = @s + N'NO_BROWSETABLE, '
if @setopts &amp;amp;amp;amp;amp; 1024 &gt; 0 select @s = @s + N'TriggerOneRow, '
if @setopts &amp;amp;amp;amp;amp; 2048 &gt; 0 select @s = @s + N'ResyncQuery, '
if @setopts &amp;amp;amp;amp;amp; 4096 &gt; 0 select @s = @s + N'ARITHABORT, '
if @setopts &amp;amp;amp;amp;amp; 8192 &gt; 0 select @s = @s + N'NUMERIC_ROUNDABORT, ' 

return @s

end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Renaming a SQL Server machine</title>
		<link>http://clay.lenharts.net/blog/2008/08/08/renaming-a-sql-server-machine/</link>
		<comments>http://clay.lenharts.net/blog/2008/08/08/renaming-a-sql-server-machine/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 20:48:14 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=38</guid>
		<description><![CDATA[Below are a collection of links on how to rename a SQL Server server. Rename the SQL Server engine. This describes how to run Rename SQL Server Reporting Services server. This describes how to update a config file with the &#8230; <a href="http://clay.lenharts.net/blog/2008/08/08/renaming-a-sql-server-machine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Below are a collection of links on how to rename a SQL Server server.</p>
<p><a href="http://support.microsoft.com/kb/303774">Rename the SQL Server engine</a>. This describes how to run</p>
<pre class="brush: sql; title: ; notranslate">sp_dropserver 'old_name'
go
sp_addserver 'new_name', 'local'
go</pre>
<p><a href="http://msdn.microsoft.com/en-us/library/ms345235.aspx">Rename SQL Server Reporting Services server</a>. This describes how to update a config file with the new server name.</p>
<p><a href="http://www.eggheadcafe.com/software/aspnet/29873173/error-installing-sql-2005.aspx">Correct an issue with SQL Server SP2 and Sysprep</a>.  This is needed when you run sysprep to rename the machine. The short of it is you will need to delete some registry entries.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/08/08/renaming-a-sql-server-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cached Execution Plans in SQL Server</title>
		<link>http://clay.lenharts.net/blog/2008/04/13/cached-execution-plans-in-sql-server/</link>
		<comments>http://clay.lenharts.net/blog/2008/04/13/cached-execution-plans-in-sql-server/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 20:38:04 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[dynamic management views]]></category>
		<category><![CDATA[execution plan]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Engine]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=35</guid>
		<description><![CDATA[This blog entry describes how you can get the SQL Server execution plan of any running statement and display the graphical representation in Enterprise Manager. <a href="http://clay.lenharts.net/blog/2008/04/13/cached-execution-plans-in-sql-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>I have been working on a performance problem recently, so you might see several blog entries with information that help me.  Hopefully they will help you.</em></p>
<p>Update: Here is a query to get the <a href="http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/">execution plan of the most frequently used queries</a>.</p>
<p>Getting the SQL Server execution plan from a production can be difficult, since you are not running the code within Enterprise Manager.  You can still get the execution plan of any running statement and display the graphical representation in Enterprise Manager.<span id="more-35"></span></p>
<p>If your script is currently running, you can <a href="http://blogs.technet.com/vipulshah/archive/2007/09/24/notes-taken-during-pass-session-plan-cache-analysis-in-sql-server-2005.aspx">lookup its execution plan</a> in the plan cache.  The steps are:</p>
<ol>
<li>Run a query to get the the plan_handle of currently running code</li>
<li>Lookup the execution plan for the plan_handle.</li>
</ol>
<p>The first query is:</p>
<pre class="brush: sql; title: ; notranslate">SELECT
sder.session_id AS [SPID],
sder.sql_handle as [SQL_Handle],
sder.plan_handle as [PLAN_Handle],
sdes.login_name AS [Login],
sd.name AS [DBName],
sder.start_time AS [Start Time],
sder.status AS [Status],
sder.command AS [Command],
sdet.text AS [SQL Text],
sder.percent_complete AS [Pct Cmplt],
sder.estimated_completion_time AS [Est Cmplt Time],
sder.wait_type AS [Wait],
sder.wait_time AS [Wait Time],
sder.last_wait_type AS [Last Wait],
sder.cpu_time AS [CPU Time],
sder.total_elapsed_time AS [Total Elpsd Time],
sder.reads AS [Reads],
sder.writes AS [Writes],
sder.logical_reads AS [Logical Reads]
FROM
sys.dm_exec_Requests sder
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sdet
JOIN sys.dm_exec_sessions sdes on sder.session_id = sdes.session_id
JOIN sys.databases sd on sder.database_id = sd.database_id
WHERE
sder.session_id &lt;&gt; @@SPID and sder.session_id &gt; 50</pre>
<p>The second query is:</p>
<pre class="brush: sql; title: ; notranslate">SELECT * FROM sys.dm_exec_query_plan ( &lt;PLAN_Handle&gt; )
--here &lt;PLAN_Handle&gt; is supplied based on
--the results from the first query.</pre>
<p>This gives you the XML execution plan that you can copy and paste into notepad, save it with a *.sqlplan extension, and double click on the file to view the graphical version of the execution plan.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/04/13/cached-execution-plans-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Table Size Query</title>
		<link>http://clay.lenharts.net/blog/2008/03/08/table-size-query/</link>
		<comments>http://clay.lenharts.net/blog/2008/03/08/table-size-query/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 00:13:59 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[dynamic management views]]></category>
		<category><![CDATA[SQL Server Engine]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/03/08/table-size-query/</guid>
		<description><![CDATA[The following query lists the tables and the space they use. This query is much faster (sub-second) than a standard SELECT COUNT(*) query since it uses the dynamic management views in SQL Server rather than scanning your data. SELECT sum &#8230; <a href="http://clay.lenharts.net/blog/2008/03/08/table-size-query/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The following query lists the tables and the space they use. This query is much faster (sub-second) than a standard SELECT COUNT(*) query since it uses the dynamic management views in SQL Server rather than scanning your data.</p>
<pre lang="sql">SELECT sum ( used_page_count ) * 8 as SizeKB,
  sum(row_count) as [RowCount], object_name ( object_id ) AS TableName
FROM sys.dm_db_partition_stats
WHERE index_id=0 or index_id=1
GROUP BY object_id
ORDER BY sum ( used_page_count ) DESC;</pre>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/03/08/table-size-query/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Finding Used Databases</title>
		<link>http://clay.lenharts.net/blog/2008/01/31/finding-used-databases/</link>
		<comments>http://clay.lenharts.net/blog/2008/01/31/finding-used-databases/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 21:56:46 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/31/finding-used-databases/</guid>
		<description><![CDATA[It can be difficult to determine which databases you are administering are actually being used. Below is a query that determines the last time an index was used since the last time SQL Server started to help narrow down these &#8230; <a href="http://clay.lenharts.net/blog/2008/01/31/finding-used-databases/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It can be difficult to determine which databases you are administering are actually being used.  Below is a query that determines the last time an index was used since the last time SQL Server started to help narrow down these databases:</p>
<pre lang="sql">
SELECT db.name, i.name, S.*, i.*
 FROM sys.dm_db_Index_Usage_Stats S
      inner join sys.databases db on db.database_id = s.database_id
      inner JOIN sys.Indexes I
              ON S.Index_Id = I.Index_Id
              AND S.Object_Id = I.Object_Id
              AND S.DataBase_Id = DB_ID()
where I.Object_Id &gt; 1000
order by db.name</pre>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/01/31/finding-used-databases/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SQL Server RAM Usage</title>
		<link>http://clay.lenharts.net/blog/2008/01/30/sql-server-ram-usage/</link>
		<comments>http://clay.lenharts.net/blog/2008/01/30/sql-server-ram-usage/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 20:52:44 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/30/sql-server-ram-usage/</guid>
		<description><![CDATA[SQL Server has difficultly managing memory for systems with a large amount of RAM (say 8+ GB), typically found in 64-bit installations. You might see log messages such as: A significant part of sql server process memory has been paged &#8230; <a href="http://clay.lenharts.net/blog/2008/01/30/sql-server-ram-usage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>SQL Server has difficultly managing memory for systems with a large amount of RAM (say 8+ GB), typically found in 64-bit installations.  You might see log messages such as:</p>
<blockquote><p>A significant part of sql server process memory has been paged out.</p></blockquote>
<p>Or worse, SSAS may fail to process a cube with the only message that it was cancelled.  To see if you have this problem, open Performance Monitor and view &#8220;Private Bytes&#8221; under the Process category.  The value should be less than the amount of physical RAM.</p>
<p>I found this following article useful in dealing with this issue: <a href="http://blogs.technet.com/askperf/archive/2007/05/18/sql-and-the-working-set.aspx">http://blogs.technet.com/askperf/archive/2007/05/18/sql-and-the-working-set.aspx</a></p>
<p>You want to configure SQL Server and SSAS to use a specific amount of RAM, but be sure to leave plenty of RAM for OS and other processes, such as SSIS packages.  Monitor Private Bytes while you run a typical workload to see how much RAM you can allocate to SQL Server and SSAS. It won&#8217;t be surprising if you allocate 2/3 of the RAM to SQL Server and SSAS, and leave 1/3 for the OS and other processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/01/30/sql-server-ram-usage/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Defragging Indexes in SQL Server 2005</title>
		<link>http://clay.lenharts.net/blog/2008/01/29/defragging-indexes-in-sql-server-2005/</link>
		<comments>http://clay.lenharts.net/blog/2008/01/29/defragging-indexes-in-sql-server-2005/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 21:56:56 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/29/defragging-indexes-in-sql-server-2005/</guid>
		<description><![CDATA[There are two ways to optimize your indexes in SQL Server 2005: ALTER INDEX &#8230; REORGANIZE ALTER INDEX &#8230; REBUILD Which one should you choose? According to BOL, it depends on how fragmented they are. The avg_fragmentation_in_percent column from the &#8230; <a href="http://clay.lenharts.net/blog/2008/01/29/defragging-indexes-in-sql-server-2005/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There are two ways to optimize your indexes in SQL Server 2005:</p>
<ul>
<li>ALTER INDEX &#8230; REORGANIZE</li>
<li>ALTER INDEX &#8230; REBUILD</li>
</ul>
<p>Which one should you choose?  According to BOL, it depends on how fragmented they are.  The avg_fragmentation_in_percent column from the  sys.dm_db_index_physical_stats() system function lets you know how fragmented your indexes are.  If the value is below 5.0, then there is no need to defragment the index.  If the value is between 5.0 and 30.0, then &#8220;ALTER INDEX &#8230; REORGANIZE&#8221;, is the best option.  If the fragmentation is greater than 30.0, then &#8220;ALTER INDEX &#8230; REBUILD&#8221; is the best option.</p>
<p>REORGANIZE has a couple of benefits. REORGANIZE will log only the pages that changed, while REBUILD will log the whole index. REORGANIZE can be done online, while REBUILD can&#8217;t (unless you add the ONLINE=ON option for Enterprise Edition installations).</p>
<p>However REBUILD will update the statistics of the index which lead to better execution plans, while REORGANIZE does not.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/01/29/defragging-indexes-in-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Backing up to a NTFS compressed folder</title>
		<link>http://clay.lenharts.net/blog/2008/01/28/backing-up-to-a-ntfs-compressed-folder/</link>
		<comments>http://clay.lenharts.net/blog/2008/01/28/backing-up-to-a-ntfs-compressed-folder/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 21:40:39 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/2008/01/28/backing-up-to-a-ntfs-compressed-folder/</guid>
		<description><![CDATA[It seems like a good idea to backup SQL Server 2005 databases to a compressed folder, however if your database is larger than roughly 30 GB, you will get the following error: BackupMedium::ReportIoError: write failure on backup device 'G:\Backups\200501220402.BAK'. Operating &#8230; <a href="http://clay.lenharts.net/blog/2008/01/28/backing-up-to-a-ntfs-compressed-folder/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It seems like a good idea to backup SQL Server 2005 databases to a compressed folder, however if your database is larger than roughly 30 GB, you will get the following error:</p>
<pre lang="sql">BackupMedium::ReportIoError: write failure on backup</pre>
<pre lang="sql">device 'G:\Backups\200501220402.BAK'. Operating system</pre>
<pre lang="sql">error 33(The process cannot access the file because</pre>
<pre lang="sql">another process has locked a portion of the file.).</pre>
<p>One way to get around this is to stripe the backup to multiple files, for instance:</p>
<pre lang="sql">BACKUP DATABASE AdventureWorks to
DISK='G:\Backups\200501220402.BAK1',
DISK='G:\Backups\200501220402.BAK2',
DISK='G:\Backups\200501220402.BAK3'
WITH FORMAT, CHECKSUM;</pre>
<p>Not ideal, but there are two options:</p>
<ol>
<li>Buy LiteSpeed Backup which includes compressed backups</li>
<li>Wait for SQL Server 2008, which includes compressed backups</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/01/28/backing-up-to-a-ntfs-compressed-folder/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008 Nov CTP Released</title>
		<link>http://clay.lenharts.net/blog/2007/11/26/sql-server-2008-nov-ctp-released/</link>
		<comments>http://clay.lenharts.net/blog/2007/11/26/sql-server-2008-nov-ctp-released/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 11:20:57 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=8</guid>
		<description><![CDATA[The November CTP for SQL Server 2008 has been released: http://www.microsoft.com/downloads/details.aspx?FamilyId=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&#38;displaylang=en]]></description>
				<content:encoded><![CDATA[<p>The November CTP for SQL Server 2008 has been released:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyId=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&amp;displaylang=en</a></p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2007/11/26/sql-server-2008-nov-ctp-released/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>List statistics and date updated</title>
		<link>http://clay.lenharts.net/blog/2007/11/25/list-statistics-and-date-updated/</link>
		<comments>http://clay.lenharts.net/blog/2007/11/25/list-statistics-and-date-updated/#comments</comments>
		<pubDate>Sun, 25 Nov 2007 14:29:42 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=7</guid>
		<description><![CDATA[The following query will list all the statistics in the current database, and the date they were lasted updated. SELECT object_name(object_id) as tablename, name AS index_name, STATS_DATE(object_id, stats_id) AS statistics_update_date FROM sys.stats WHERE object_id &#62; 1000 ORDER BY object_name(object_id), STATS_DATE(object_id, &#8230; <a href="http://clay.lenharts.net/blog/2007/11/25/list-statistics-and-date-updated/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The following query will list all the statistics in the current database, and the date they were lasted updated.</p>
<pre lang="sql">
SELECT object_name(object_id) as tablename,

 name AS index_name,

 STATS_DATE(object_id, stats_id) AS statistics_update_date

FROM sys.stats

WHERE object_id &gt; 1000

ORDER BY object_name(object_id), STATS_DATE(object_id, stats_id);</pre>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2007/11/25/list-statistics-and-date-updated/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
