<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkAMRXg-eyp7ImA9WhRUFks.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389</id><updated>2012-01-27T11:46:24.653Z</updated><category term="indexes" /><category term="openrowset" /><category term="active directory" /><category term="tools" /><category term="sysadmin" /><category term="tsql" /><category term="news" /><category term="windows 2008 R2" /><category term="web" /><category term="tds" /><category term="sql agent" /><category term="community" /><category term="bookmark. ssc" /><category term="storage" /><category term="restore" /><category term="group policy" /><category term="iphone" /><category term="configuration" /><category term="powershell" /><category term="function" /><category term="searching" /><category term="video" /><category term="email" /><category term="performance" /><category term="collation" /><category term="xp" /><category term="asp" /><category term="xml" /><category term="virtualbox" /><category term="erformance" /><category term="iis" /><category term="hyper-v" /><category term="mysql" /><category term="security" /><category term="cdc" /><category term="event forwarding" /><category term="schema" /><category term="service broker" /><category term="101" /><category term="Agile / Scrum" /><category term="memory" /><category term="ssis" /><category term="wsus" /><category term="networking" /><category term="schemas" /><category term="sql 2005" /><category term="constraints" /><category term="permissions" /><category term="ssrs" /><category term="compatibility" /><category term="view" /><category term="mac" /><category term="sqlbits" /><category term="design" /><category term="virtual pc 2007" /><category term="datetime" /><category term="testing" /><category term="blogging" /><category term="vista" /><category term="annoyances" /><category term="opendatasource" /><category term="jdbc" /><category term="admin" /><category term="sql 2011" /><category term="pivot" /><category term="dynamic sql" /><category term="partitioning" /><category term="nulls" /><category term="blocking" /><category term="compression" /><category term="shrink" /><category term="excel" /><category term="reporting services" /><category term="systems" /><category term="crosstab" /><category term="sql 2000" /><category term="code" /><category term="windows 2000" /><category term="table compression" /><category term="scripts" /><category term="Windows 7" /><category term="vba" /><category term="diagramming" /><category term="linked servers" /><category term="dmv" /><category term="windows 2008" /><category term="resource governor" /><category term="backups" /><category term="synonyms" /><category term="system objects" /><category term="sql 2008 r2" /><category term="clr" /><category term="bookmark" /><category term="ole" /><category term="BI" /><category term="career" /><category term="connectivity" /><category term="sqlservercentral" /><category term="caching" /><category term="recovery mode" /><category term="sql 2008" /><category term="datawarehouse" /><category term="replication" /><category term="pbm" /><title>sql solace</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://sqlsolace.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>881</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SqlSolace" /><feedburner:info uri="sqlsolace" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;C0MCR3czfSp7ImA9WhRWFk4.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-1241297135089547580</id><published>2012-01-03T22:40:00.000Z</published><updated>2012-01-03T22:57:46.985Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-03T22:57:46.985Z</app:edited><title>2011</title><content type="html">In common with a lot of technical bloggers I have been publicly setting and reviewing goals over the past few years. I find that having long term goals outside of the workplace keeps me focused and increases the breadth of my skill set.&lt;br /&gt;
&lt;br /&gt;
That is all very well and has worked in the past for me. In 2011 however I fell short of achieving all of&amp;nbsp; the &lt;a href="http://sqlsolace.blogspot.com/2011/01/goals-for-2011.html"&gt;tasks I set myself&lt;/a&gt;. Anyway, here is my autopsy of my goal list from last year.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: blue;"&gt;A new role&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I achieved this goal and started in April 2011. The role has been challenging in terms of the volume of work and has forced me to up my game re; communication skills. Technically however, the technologies are old and simple issues are repeated over geographically separate client sites. In terms of skills I have still been able to utilize a mixture of administration and development. &lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Blogging&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
My output to this site has been less than half that of previous years and has occurred in bursts rather than the usual trickle. I found myself constantly returning to old posts and scripts last year so my efforts have paid dividends. I need to index the site better however so that will be on this years list! Rather bizarrely a lot of content has been focused on SQL 2000 which I thought I had long seen the back of! The client is always right (or skint) however...&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Community&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
I did manage to publish more scripts although only on my site (no further SSC contributions this year). As for publishing articles (to other sites) I totally failed on this goal.&lt;br /&gt;
In terms of SQL Server events I managed to attend 3 in 2011. In April there was SQLBits 8 in Brighton and September saw me attend (and help out at) &lt;a href="http://sqlsolace.blogspot.com/2011/10/sqlbits-9.html"&gt;SQLBits 9 in Liverpool&lt;/a&gt;.&lt;br /&gt;
The 3rd event I attended was Gavin Payne's October &lt;a href="http://sqlsolace.blogspot.com/2011/10/sql-server-in-evening-4th-event.html"&gt;SQL Server in the Evening&lt;/a&gt; event where I made my speaking debut. In line with recent experiences I presented my approach to auditing SQL Server systems. Public speaking wasn't in the plan but I am grateful for the opportunity to conquer a demon.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Learning&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
I am a little disappointed not to have had the chance for a major project that requires SSAS, SSIS or .NET development so these will remain on my list. In terms of reading, my book backlog is not being helped by the volume of quality SQL content the community is producing. Time has not been on my side of late and my reading list is being joined by a viewing list of awesome free training videos!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-1241297135089547580?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rxX647qYpkXyvEdbRy8s-Maz60c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rxX647qYpkXyvEdbRy8s-Maz60c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rxX647qYpkXyvEdbRy8s-Maz60c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rxX647qYpkXyvEdbRy8s-Maz60c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/OTNPMM-DH2I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/1241297135089547580/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=1241297135089547580&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1241297135089547580?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1241297135089547580?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/OTNPMM-DH2I/2011.html" title="2011" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2012/01/2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YEQXc4eip7ImA9WhRSFU8.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-4208573506037819828</id><published>2011-11-16T23:27:00.001Z</published><updated>2011-11-17T09:11:40.932Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-17T09:11:40.932Z</app:edited><title>TSQL : TOP N PER GROUP using RANK()</title><content type="html">An Adventureworks quick script to demonstrate top items in a group.
It isn't the query I wrote today, but it is one I can publish here!

&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;-- Sales Order ID, Name and Price for the 3 most expensive items in each order
-- We join to a derived table utilising the RANK function to order the items in each order by expense.
-- The WHERE clause then restricts the results according to the output of the RANK function
SELECT 
  S.SalesOrderID
 ,P.Name
 ,D.UnitPrice
FROM Sales.SalesOrderHeader S
INNER JOIN
 (SELECT 
  RANK() OVER (PARTITION BY SalesOrderID ORDER BY UnitPrice DESC) ItemCount
  ,* 
  FROM Sales.SalesOrderDetail)  D
ON S.SalesOrderID = D.SalesOrderID
INNER JOIN Production.Product P
ON P.ProductId = D.ProductId
WHERE ItemCount &amp;lt;= 3
ORDER BY SalesOrderID, Name, UnitPrice 
&lt;/pre&gt;


Solace : &lt;a href="http://sqlsolace.blogspot.com/2011/04/tsql-rownumber-rank-denserank-and.html"&gt;Tsql : ROW_NUMBER, RANK, DENSE_RANK and PARTITION BY&lt;/a&gt;
&lt;br&gt;&lt;br&gt;
Luke Hayler : &lt;a href="http://lukehayler.com/2010/04/rediscovering-rank-selecting-the-top-n-rows-for-each-group-or-category/"&gt;Rediscovering RANK&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-4208573506037819828?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YgaU9HOV9PhLK5vbRsZcRZcUWEw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YgaU9HOV9PhLK5vbRsZcRZcUWEw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YgaU9HOV9PhLK5vbRsZcRZcUWEw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YgaU9HOV9PhLK5vbRsZcRZcUWEw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/4k0lXre1SY0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/4208573506037819828/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=4208573506037819828&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/4208573506037819828?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/4208573506037819828?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/4k0lXre1SY0/tsql-top-n-per-group-using-rank.html" title="TSQL : TOP N PER GROUP using RANK()" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/11/tsql-top-n-per-group-using-rank.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYMQHY7eyp7ImA9WhRSFEU.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-5585117801993569113</id><published>2011-11-03T14:22:00.000Z</published><updated>2011-11-16T23:29:41.803Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-16T23:29:41.803Z</app:edited><title>Management Studio Error : mscorlib.tlb could not be loaded</title><content type="html">For testing purposes, I've got a VM with SQL 2000, 2005 &amp;amp; 2008 all as named instances. Yes I know it sucks performance wise but it is only for testing deployment scripts!&lt;br /&gt;
&lt;br /&gt;
Anyway, after installing it and applying the various service packs, I got this error :&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;mscorlib.tlb could not be loaded&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
The 'Microsoft Fix it 50701' hotfix downloadble &lt;a href="http://support.microsoft.com/kb/918685"&gt;here&lt;/a&gt; did not work for me, but scroll down that page and you'll find instructions to modify the registry. It points Management Studio at the correct version of the .NET framework. These did work, the only problem being I'm reportedly going to have to do this each time I patch SQL :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-5585117801993569113?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RwwLiTfi_ODFKWIEfKQJ2Ra7ig8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RwwLiTfi_ODFKWIEfKQJ2Ra7ig8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RwwLiTfi_ODFKWIEfKQJ2Ra7ig8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RwwLiTfi_ODFKWIEfKQJ2Ra7ig8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/vRSwadK6zIg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/5585117801993569113/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=5585117801993569113&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/5585117801993569113?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/5585117801993569113?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/vRSwadK6zIg/management-studio-error-mscorlibtlb.html" title="Management Studio Error : mscorlib.tlb could not be loaded" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/11/management-studio-error-mscorlibtlb.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkADRHo9eip7ImA9WhdaGE4.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-1508967287106494611</id><published>2011-10-28T19:13:00.000+01:00</published><updated>2011-10-28T22:52:55.462+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-28T22:52:55.462+01:00</app:edited><title>Could not access Maintenance Plans in Management Studio</title><content type="html">&lt;b&gt;Error :&lt;/b&gt; &lt;br /&gt;
Method not found: 'Void Microsoft.SqlServer.Management.DatabaseMaintenance.TaskUIUtils..ctor()'. (Microsoft.SqlServer.MaintenancePlanTasksUI)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-lCKbx2n1T5U/TqrUmCy-X4I/AAAAAAAAAxM/vRdG5pN8jG8/s1600/MaintPlanVoid.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="126" src="http://4.bp.blogspot.com/-lCKbx2n1T5U/TqrUmCy-X4I/AAAAAAAAAxM/vRdG5pN8jG8/s400/MaintPlanVoid.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Investigation :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
SQL Server 2005 Management Studio is unpatched (9.00.1399)&lt;br /&gt;
Running SELECT @@Version shows the database engine is to be at Cumulative Update 9 (9.00.4294).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution :&lt;/b&gt; &lt;br /&gt;
Apply Service Pack to Management Studio&lt;br /&gt;
&lt;br /&gt;
Ref : &lt;a href="http://mbsturk.blogspot.com/2010/03/method-not-found-void.html"&gt;http://mbsturk.blogspot.com/2010/03/method-not-found-void.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-1508967287106494611?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SU_ZdkiAidhblg5ailVl7nNotcY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SU_ZdkiAidhblg5ailVl7nNotcY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SU_ZdkiAidhblg5ailVl7nNotcY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SU_ZdkiAidhblg5ailVl7nNotcY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/RJg8qlpfDAU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/1508967287106494611/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=1508967287106494611&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1508967287106494611?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1508967287106494611?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/RJg8qlpfDAU/could-not-access-maintenance-plans-in.html" title="Could not access Maintenance Plans in Management Studio" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-lCKbx2n1T5U/TqrUmCy-X4I/AAAAAAAAAxM/vRdG5pN8jG8/s72-c/MaintPlanVoid.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/10/could-not-access-maintenance-plans-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIASH89eyp7ImA9WhRWF0U.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-407992061494626026</id><published>2011-10-18T19:55:00.000+01:00</published><updated>2012-01-05T16:55:49.163Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-05T16:55:49.163Z</app:edited><title>Renaming SQL Server Instances</title><content type="html">Working with virtual machines frequently now I often duplicate entire systems for testing purposes and rename the newly created machine. When SQL Server is included in these images, the new copy is left not knowing what it's own name is.&lt;br /&gt;
&lt;br /&gt;
To tell SQL it has been renamed, you need to run the following.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;sp_helpserver
select @@servername
go
 
sp_dropserver 'OLDSNAME'
go
sp_addserver 'NEWNAME','local'
go
 
sp_helpserver
select @@servername
go
&lt;/pre&gt;
&lt;br /&gt;
Remember you will need to restart the SQL Server service after executing this.

You could even do it automatically using this &lt;a href="http://sqlsolace.blogspot.com/2007/04/rename-sql-installation.html"&gt;Rename SQL Installation&lt;/a&gt; script from back in the day. It will detect the names automatically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-407992061494626026?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LJFkY4Nl9M543f0keNUuP8fCEFM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LJFkY4Nl9M543f0keNUuP8fCEFM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LJFkY4Nl9M543f0keNUuP8fCEFM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LJFkY4Nl9M543f0keNUuP8fCEFM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/XU4PTeQ0M04" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/407992061494626026/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=407992061494626026&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/407992061494626026?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/407992061494626026?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/XU4PTeQ0M04/renaming-sql-server-instances.html" title="Renaming SQL Server Instances" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/10/renaming-sql-server-instances.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEACR3w5eyp7ImA9WhRSFEU.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-799497177482888540</id><published>2011-10-04T00:00:00.002+01:00</published><updated>2011-11-16T23:39:26.223Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-16T23:39:26.223Z</app:edited><title>SQL People Interview</title><content type="html">My SQLPeople Interview was published today. You can read it here -&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://sqlpeople.net/admin/2011/10/03/richard-doering/"&gt;http://sqlpeople.net/admin/2011/10/03/richard-doering/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
SQLPeople is the brainchild of SSIS Guru Andy Leonard (who I met when he flew over to the UK last week to present at &lt;a href="http://sqlsolace.blogspot.com/2011/10/sqlbits-9.html"&gt;SQLBits 9&lt;/a&gt;). It is a community project running events in the US (as well as the website). I found the site recently and enjoyed reading the DBA interviews. More proof if it were needed of the wide range of roles &lt;a href="http://sqlsolace.blogspot.com/2011/01/goals-for-2011.html"&gt;the term 'DBA' can encompass&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
r&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-799497177482888540?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/A-aD7tG0m8KhNghLAfmIJtdXLWE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/A-aD7tG0m8KhNghLAfmIJtdXLWE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/A-aD7tG0m8KhNghLAfmIJtdXLWE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/A-aD7tG0m8KhNghLAfmIJtdXLWE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/0dFvhNv_3RQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/799497177482888540/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=799497177482888540&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/799497177482888540?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/799497177482888540?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/0dFvhNv_3RQ/sql-people-interview.html" title="SQL People Interview" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/10/sql-people-interview.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8HQXY-fip7ImA9WhRWF0U.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-2100577227507871114</id><published>2011-10-03T23:48:00.000+01:00</published><updated>2012-01-05T17:17:10.856Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-05T17:17:10.856Z</app:edited><title>SQL Server in the Evening (4th Event)</title><content type="html">&lt;br /&gt;
This evening was a first for me. Fresh (knackered) from helping out at SQLBits at the weekend I faced one of my demons and made my debut at public speaking.&lt;br /&gt;
&lt;br /&gt;
The opportunity was provided to me by &lt;a href="http://sqlblogcasts.com/blogs/gavinpayneuk/"&gt;Gavin Payne&lt;/a&gt; (&lt;a href="http://twitter.com/#%21/gavinpayneuk"&gt;@GavinPayneUK&lt;/a&gt;)&amp;nbsp; and it was tonight at his '&lt;a href="http://sqlserverintheevening.com/"&gt;SQL Server in the evening&lt;/a&gt;' event that i took the beginners slot. The event is a SQL Server user group that runs in West Surrey. Tonight's venue was the Ramada Hotel on the Hog's Back in Farnham.&lt;br /&gt;
&lt;br /&gt;
My session was first (no pressure) and was entitled &lt;b&gt;CSI SQL : Auditing SQL Server&lt;/b&gt;. I felt I did ok but was initially rather nervous. My content addressed the way I have recently approached a large number of audits of SQL Server installations. It had quite a wide scope and was more of a memory jogger than a technical indepth talk. I finished by presenting the spreadsheets and scripts I developed to quickly audit systems. On a side note I loved the usb powerpoint clicker and have since put one on my birthday wish list (should I get the whim to present again!). I enjoyed doing it and found the positive feedback extremely encouraging.&lt;br /&gt;
&lt;br /&gt;
After an delicious but delayed buffet (my fault for overrunning my time slot) we were treated to 2 further presentations. The first was an inspiring deep dive into PowerShell by &lt;a href="http://www.poshpete.com/"&gt;Pete Rossi&lt;/a&gt;&amp;nbsp;&amp;nbsp; (&lt;a href="http://twitter.com/#%21/rossipete"&gt;@RossiPete&lt;/a&gt;).&amp;nbsp; Powershell is high on my 'must play with' list for automating administration so I found this quite an eye opening session. Finally AlwaysOn functionality in Denali was the topic for Microsoft Certified Master &lt;a href="http://sqlblogcasts.com/blogs/christian/"&gt;Christian Bolton&lt;/a&gt;. Christian spent an hour explaining the how High Availability in SQL Server 2012 has improved.&lt;br /&gt;
&lt;br /&gt;
A great evening overall and a large weight lifted for me by public speaking.&lt;br /&gt;
&lt;br /&gt;
r&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-2100577227507871114?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Avf2WTcwmmqeZi6cf1ZvLrhEO64/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Avf2WTcwmmqeZi6cf1ZvLrhEO64/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Avf2WTcwmmqeZi6cf1ZvLrhEO64/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Avf2WTcwmmqeZi6cf1ZvLrhEO64/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/KwwnU_-9q9o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/2100577227507871114/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=2100577227507871114&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2100577227507871114?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2100577227507871114?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/KwwnU_-9q9o/sql-server-in-evening-4th-event.html" title="SQL Server in the Evening (4th Event)" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/10/sql-server-in-evening-4th-event.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MEQXk_eip7ImA9WhdbGUg.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-2740701237592467261</id><published>2011-10-03T13:11:00.000+01:00</published><updated>2011-10-18T16:23:20.742+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-18T16:23:20.742+01:00</app:edited><title>Windows 2003 : Reviewing Cluster Logs</title><content type="html">Spent some time corresponding SQL events with the cluster event log today.
A cluster failing over seemingly without good cause.

Look for -
&lt;b&gt;Source - Clussvc
Category - Failover Manager&lt;/b&gt;

&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-ce41pW2NUWs/Tp1siG_t4dI/AAAAAAAAAxE/VnjQRgAWBS8/s1600/ClusterFailover.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="229" src="http://1.bp.blogspot.com/-ce41pW2NUWs/Tp1siG_t4dI/AAAAAAAAAxE/VnjQRgAWBS8/s400/ClusterFailover.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The cause will be another blog post!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-2740701237592467261?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/U0wQFznO1HJIHg_WjIHY2GWAB3I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U0wQFznO1HJIHg_WjIHY2GWAB3I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/U0wQFznO1HJIHg_WjIHY2GWAB3I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U0wQFznO1HJIHg_WjIHY2GWAB3I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/1HSYPJKMHWI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/2740701237592467261/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=2740701237592467261&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2740701237592467261?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2740701237592467261?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/1HSYPJKMHWI/windows-2003-cluster-service.html" title="Windows 2003 : Reviewing Cluster Logs" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-ce41pW2NUWs/Tp1siG_t4dI/AAAAAAAAAxE/VnjQRgAWBS8/s72-c/ClusterFailover.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/10/windows-2003-cluster-service.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEESHo8cSp7ImA9WhRTF0U.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-6323533482084315896</id><published>2011-10-02T20:28:00.000+01:00</published><updated>2011-11-08T20:36:49.479Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-08T20:36:49.479Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sqlbits" /><title>SQLBits 9</title><content type="html">The 9th &lt;a href="http://www.sqlbits.com/"&gt;SQLBits&lt;/a&gt; was held in Liverpool this weekend. Despite it being 226 miles away from home that was no deterant for a few days of quality SQL content, company and beer.&lt;br /&gt;
&lt;br /&gt;
This was my 5th SQLBits and I volunteered to help. This meant room monitoring (helping spearkers, tidying up etc) , helping attendees (mainly find rooms) and other light duties. For me volunteering gave me a purpose between sessions. Knowing the distributed nature of my work meant I was not able to furfil purchases from the exhibiting vendors I prefered not to add myself (once again) to their mailing lists. There is also a limit to how many conference freebies even my kids would appreciate!&lt;br /&gt;
&lt;br /&gt;
The volunteering meant some of my sessions were allocated for me. This was fine as volunteers had given session preferences so they wouldnt miss content they needed. Ensuring everything went smoothly was expertly organised by Annette Allen (&lt;a href="https://twitter.com/#%21/Mrs_Fatherjack"&gt;@Mrs_Fatherjack&lt;/a&gt;). I'm already looking forward to SQLBits 10 and would encourage SQL Professionals to make this a regular date. As a learning and social experience, SQLBits (and the SQLBits community) rocks!&lt;br /&gt;
&lt;br /&gt;
The sessions I attended this time round, were -&lt;br /&gt;
&lt;br /&gt;
Performance tuning from the field&lt;br /&gt;
Simon Sabin &lt;br /&gt;
&lt;br /&gt;
Lightning Talks&lt;br /&gt;
Various Speakers &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Myths and Monsters of Flash&lt;br /&gt;
Fusion-io &lt;br /&gt;
&lt;br /&gt;
Advanced SQL Server 2008 Troubleshooting&lt;br /&gt;
Klaus Aschenbrenner &lt;br /&gt;
&lt;br /&gt;
The Art of War-Fast Track Data Warehouse &amp;amp; Fragmentation&lt;br /&gt;
James Rowland-Jones&lt;br /&gt;
&lt;br /&gt;
Designing an SSIS Framework&lt;br /&gt;
Andy Leonard &lt;br /&gt;
&lt;br /&gt;
Building a SSMS Add-in; The Agony and Ecstasy&lt;br /&gt;
Mark Pryce-Maher&lt;br /&gt;
&lt;br /&gt;
Understanding SQL Server Execution Plans&lt;br /&gt;
Klaus Aschenbrenner &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
Through the virtual looking glass – monitoring virtualised SQL&lt;br /&gt;
Gavin Payne&lt;br /&gt;
&lt;br /&gt;
Whats new in Denali-TSQL&lt;br /&gt;
Dave Ballantyne &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other SqlBits 9 Coverage :&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://sql.richarddouglas.co.uk/archive/2011/10/sqlbits-9-roundup.html"&gt;Richard Douglas&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.eduserv.org.uk/2011/10/13/sqlbits-query-across-the-mersey/"&gt;Victoria Holt&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://tenbulls.co.uk/events/sqlbits/sqlbits-9/"&gt;Mark Broadbent&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: red;"&gt;Update, November 2011 :&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="color: red;"&gt;The conference videos have been uploaded in record time and are now available at &lt;/span&gt;&lt;a href="http://sqlbits.com/" style="color: red;"&gt;sqlbits.com&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-6323533482084315896?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qd-8GmE19us6jXmVRA2UBvrlDsU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qd-8GmE19us6jXmVRA2UBvrlDsU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qd-8GmE19us6jXmVRA2UBvrlDsU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qd-8GmE19us6jXmVRA2UBvrlDsU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/08cAndoXDns" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/6323533482084315896/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=6323533482084315896&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/6323533482084315896?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/6323533482084315896?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/08cAndoXDns/sqlbits-9.html" title="SQLBits 9" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/10/sqlbits-9.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIHQHw8fCp7ImA9WhRSE00.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-7438294772233135773</id><published>2011-09-17T20:55:00.000+01:00</published><updated>2011-11-14T21:02:11.274Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-14T21:02:11.274Z</app:edited><title>Are my databases being used?</title><content type="html">I came across a SQL 2005 server recently where it's administrator had forgotten which databases were in use (among other things). With the goal of wanting to perform a tidy up on the server, I wrote this script to prevent a lenghty, painful manual process.&lt;br /&gt;
&lt;br /&gt;
The script fetches data about when the databases were last used and returns the following&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;DatabaseName (Obvious really)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;LastReadOperation - aggregated from index information in sys.dm_db_index_usage_stats&lt;/li&gt;
&lt;li&gt;LastWriteOperation - aggregated from index information in sys.dm_db_index_usage_stats&lt;/li&gt;
&lt;li&gt;DataFileDateStamp - file system date stamp&amp;nbsp;&lt;/li&gt;
&lt;li&gt;LogFileDateStamp - file system date stamp&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;

It is based on '&lt;a href="http://sqlsolace.blogspot.com/2011/09/when-were-my-databases-last-accessed.html"&gt;When were my databases last accessed ?&lt;/a&gt;' and fetches the file date information from the file system by using &lt;a href="http://sqlsolace.blogspot.com/2011/09/dbogetfiledate.html"&gt;dbo.get_file_date&lt;/a&gt;.
To fetch the file system information, it does use xp_cmdshell , which may be a security concern depending on your environment.

Becauase it uses the file system, you need to run it in Management Studio on the server you are auditing.&lt;br /&gt;
&lt;br /&gt;

&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;USE master
GO

exec sp_configure 'show advanced options', 1;
reconfigure;
exec sp_configure 'xp_cmdshell',1;
reconfigure;
GO
IF OBJECT_ID('tempdb..##Results') IS NOT NULL
 BEGIN
 DROP TABLE ##Results
 END

CREATE TABLE ##Results ([DatabaseName] sysname NULL, [FileName] sysname NULL, [PhysicalName] NVARCHAR(260) NULL,  
    [FileType] VARCHAR(4) NULL, [DateFileSystem] DATETIME ) 
DECLARE @SQL VARCHAR(MAX)
 SELECT @SQL =  
 'USE [?] INSERT INTO ##Results([DatabaseName], [FileName], [PhysicalName],  
 [FileType])  
 SELECT DB_NAME(), 
 [name] AS [FileName],  
 physical_name AS [PhysicalName],  
 [FileType] =  
 CASE type 
 WHEN 0 THEN ''Data'''  
 +  'WHEN 1 THEN ''Log''' 
 +  'END
 FROM sys.database_files  (NOLOCK)
 ORDER BY [FileType], [file_id]' 
 
EXEC sp_MSforeachdb @SQL 
 
DECLARE @file_date_op datetime 

DECLARE  @db SYSNAME
DECLARE @filename NVARCHAR(260)
DECLARE tablecursor CURSOR FORWARD_ONLY FOR 
SELECT databasename, physicalname 
FROM   ##results

OPEN tablecursor 

WHILE (1 = 1) 
BEGIN 
FETCH NEXT FROM tablecursor 
INTO @db,@filename 

IF @@FETCH_STATUS &amp;lt;&amp;gt; 0 
BREAK; 
SET @file_date_op = null
print @filename
exec master.dbo.get_file_date 
  @file_name = @filename
 ,@file_date = @file_date_op OUTPUT
UPDATE ##Results 
SET  DateFileSystem = @file_date_op
WHERE   physicalname = @filename 
END 
CLOSE tablecursor 
DEALLOCATE tablecursor 

SELECT
 Name AS DatabaseName
   ,REPLACE(CONVERT(VARCHAR(30),MAX(CASE 
  WHEN ISNULL(last_user_seek,0) &amp;gt;= ISNULL(last_user_scan,0) AND ISNULL(last_user_seek,0) &amp;gt;= ISNULL(last_user_lookup,0) THEN ISNULL(last_user_seek,0)
  WHEN ISNULL(last_user_scan,0) &amp;gt;= ISNULL(last_user_lookup,0) THEN ISNULL(last_user_scan,0)
  ELSE ISNULL(last_user_lookup,0)
  END),121),'1900-01-01 00:00:00.000','') AS LastReadOperation
   ,REPLACE(CONVERT(VARCHAR(30),ISNULL(MAX(last_user_update),0),121),'1900-01-01 00:00:00.000','')  AS LastWriteOperation
   ,DataFile.DateFileSystem AS DataFileDateStamp
   ,LogFile.DateFileSystem AS LogFileDateStamp
FROM sys.databases d
LEFT JOIN sys.dm_db_index_usage_stats s
ON s.database_id = d.database_id 
LEFT JOIN ##Results DataFile
ON DataFile.DatabaseName = DB_NAME(d.database_id)
LEFT JOIN ##Results LogFile
ON LogFile.DatabaseName = DB_NAME(d.database_id)
WHERE DataFile.FileType = 'Data'
  AND LogFile.FileType = 'Log'
GROUP BY 
 d.name
   ,DataFile.DateFileSystem
   ,LogFile.DateFileSystem

GO

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-7438294772233135773?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vls4aRkM67c9naBVFYr7cMugLYE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vls4aRkM67c9naBVFYr7cMugLYE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vls4aRkM67c9naBVFYr7cMugLYE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vls4aRkM67c9naBVFYr7cMugLYE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/6K9y2wXE2i0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/7438294772233135773/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=7438294772233135773&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7438294772233135773?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7438294772233135773?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/6K9y2wXE2i0/are-my-databases-being-used.html" title="Are my databases being used?" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/09/are-my-databases-being-used.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4BSHg-fyp7ImA9WhRSE00.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-8321136858014815390</id><published>2011-09-14T20:49:00.000+01:00</published><updated>2011-11-14T20:52:39.657Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-14T20:52:39.657Z</app:edited><title>When were my databases last accessed?</title><content type="html">This script uses sys.dm_db_index_usage_stats to get timestamps for the last read and write operations for a database.

&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;SELECT
 DB_NAME(database_id) AS DatabaseName
   ,MAX(CASE 
  WHEN ISNULL(last_user_seek,'1900-01-01') &amp;gt;= ISNULL(last_user_scan,'1900-01-01') AND ISNULL(last_user_seek,'1900-01-01') &amp;gt;= ISNULL(last_user_lookup,'1900-01-01') THEN ISNULL(last_user_seek,'1900-01-01')
  WHEN ISNULL(last_user_scan,'1900-01-01') &amp;gt;= ISNULL(last_user_lookup,'1900-01-01') THEN ISNULL(last_user_scan,'1900-01-01')
  ELSE ISNULL(last_user_lookup,'1900-01-01')
  END) AS LastReadOperation
   ,MAX(last_user_update) AS LastWriteOperation
FROM sys.dm_db_index_usage_stats
GROUP BY 
 DB_NAME(database_id)


&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-8321136858014815390?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fpmFTp7viWkMBMxF62trHtYWr9c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fpmFTp7viWkMBMxF62trHtYWr9c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fpmFTp7viWkMBMxF62trHtYWr9c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fpmFTp7viWkMBMxF62trHtYWr9c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/rSvESLii85s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/8321136858014815390/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=8321136858014815390&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/8321136858014815390?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/8321136858014815390?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/rSvESLii85s/when-were-my-databases-last-accessed.html" title="When were my databases last accessed?" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/09/when-were-my-databases-last-accessed.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYCR3Y_cSp7ImA9WhRSE00.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-947169353651622319</id><published>2011-09-09T20:38:00.000+01:00</published><updated>2011-11-14T20:39:26.849Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-14T20:39:26.849Z</app:edited><title>dbo.get_file_date</title><content type="html">This procedure gets the date a file was updated, as reported by the file system.
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;exec sp_configure 'show advanced options', 1;
reconfigure;
exec sp_configure 'xp_cmdshell',1;
reconfigure;
go

use master
go

create procedure [dbo].[get_file_date](
@file_name varchar(max)
,@file_date datetime output
) AS 
BEGIN 
set dateformat dmy
declare @dir table(id int identity primary key, dl varchar(2555))
declare @cmd_name varchar(8000),@fdate datetime,@fsize bigint, @fn varchar(255)
set @fn=right(@file_name,charindex('\',reverse(@file_name))-1)
set @cmd_name='dir /-C "'+@file_name+'"'

insert @dir
exec master..xp_cmdshell @cmd_name

select @file_date=convert(datetime,ltrim(left(dl,charindex('   ',dl))),103) 
from @dir where dl like '%'+@fn+'%'

end
go
&lt;/pre&gt;
usage - 

&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;declare @file_date_op datetime 

exec master.dbo.get_file_date 
  @file_name = 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\MSDBData.mdf'
 ,@file_date = @file_date_op OUTPUT

SELECT @file_date_op

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-947169353651622319?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-5WquGUZAQi5tQ_dUGofldhw_yI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-5WquGUZAQi5tQ_dUGofldhw_yI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-5WquGUZAQi5tQ_dUGofldhw_yI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-5WquGUZAQi5tQ_dUGofldhw_yI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/9Y1kfroebHs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/947169353651622319/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=947169353651622319&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/947169353651622319?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/947169353651622319?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/9Y1kfroebHs/dbogetfiledate.html" title="dbo.get_file_date" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/09/dbogetfiledate.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEFSX0yeSp7ImA9WhdWEUs.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-6898167381495039422</id><published>2011-09-02T00:05:00.000+01:00</published><updated>2011-09-04T20:13:38.391+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-04T20:13:38.391+01:00</app:edited><title>SQL 2005 : Maintenance Plan won't update, Agent job won't delete</title><content type="html">I'm sure this is a documented bug somewhere, but I came across a Maintenance Plan / Agent Job issue today. The client was running SQL 2005 SP2 (Build 9.00.3042.00)&lt;br /&gt;
&lt;br /&gt;
I created a Maintenance Plan (Transaction Log backups), scheduled it (for every 30 minutes) and it ran fine for a few hours. I came back to it today to find it no longer running.
On examining the Maintenance Plan it would not let me view the schedule, returning to SQL Agent jobs I was unable to delete the job either.&lt;br /&gt;
&lt;br /&gt;
The message I got was -&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-C7BDMuFXIeo/Tl7L0VW51GI/AAAAAAAAAws/4MQ1JFZQbAI/s1600/CannotDeleteAgentJob.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://3.bp.blogspot.com/-C7BDMuFXIeo/Tl7L0VW51GI/AAAAAAAAAws/4MQ1JFZQbAI/s400/CannotDeleteAgentJob.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Trying the same from TSQL,
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;delete from sysmaintplan_subplans
where subplan_description = 'TL backups'
&lt;/pre&gt;
&lt;br /&gt;
Produced the same -&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
Msg 547, Level 16, State 0, Line 2
The DELETE statement conflicted with the REFERENCE constraint "FK_sysmaintplan_log_subplan_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_log", column 'subplan_id'.
The statement has been terminated.
&lt;/div&gt;
&lt;br /&gt;
This left me we with 3 options.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Disabling constraints in a system database in order to delete the record (not recommended)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Working out the order to delete maintenance plan records from system tables in order to obey referential integrity&amp;nbsp;&lt;/li&gt;
&lt;li&gt;
Finding someone who has done it before.
 &lt;/li&gt;
&lt;/ol&gt;
Fortunately option 3 was just a few keystrokes away. Clay McDonald has already written a procedure and has published it in this awesome workaround : 
&lt;a href="http://claysql.blogspot.com/2009/07/cant-delete-job-microsoft-sql-server.html"&gt;Can’t Delete Jobs (Microsoft SQL Server, Error: 547)&amp;nbsp;&lt;/a&gt; 
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-6898167381495039422?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RqOq9FoC9i_-_KNO59Gfo0bGC6U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RqOq9FoC9i_-_KNO59Gfo0bGC6U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RqOq9FoC9i_-_KNO59Gfo0bGC6U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RqOq9FoC9i_-_KNO59Gfo0bGC6U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/HU-L9ZaaBiY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/6898167381495039422/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=6898167381495039422&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/6898167381495039422?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/6898167381495039422?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/HU-L9ZaaBiY/sql-2005-maintenance-plan-wont-update.html" title="SQL 2005 : Maintenance Plan won't update, Agent job won't delete" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-C7BDMuFXIeo/Tl7L0VW51GI/AAAAAAAAAws/4MQ1JFZQbAI/s72-c/CannotDeleteAgentJob.JPG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/09/sql-2005-maintenance-plan-wont-update.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AESH48eyp7ImA9WhdXGEo.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-4980109090987554064</id><published>2011-08-31T23:24:00.002+01:00</published><updated>2011-09-01T12:15:09.073+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-01T12:15:09.073+01:00</app:edited><title>Checking CHECKDB !</title><content type="html">When reviewing some agent logs this morning it struck me that the maintenance plans had run a little quickly. The agent job hadn't failed, but the run duration seemed remarkably short (considering the database size). The plan concerned was one of those 'all maintenance in one step' jobs hence I couldn't quantify how the run duraton was comprised. Backups were present in their directory, so one of the other steps must have silently failed.&lt;br /&gt;
&lt;br /&gt;
Running a server audit script picked up Integrity Checks as not having occurred. My audit script uses this piece of code to get the date.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;CREATE TABLE #temp (        
       [ParentObject]    VARCHAR(255)
       , [Object]       VARCHAR(255)
       , Field          VARCHAR(255)
       , [Value]        VARCHAR(255) 
   ) 

INSERT INTO #temp EXECUTE ('DBCC DBINFO WITH TABLERESULTS')

SELECT DISTINCT Value AS DBCCDate FROM #temp WHERE Field = 'dbi_dbccLastKnownGood'
&lt;/pre&gt;
&lt;br /&gt;
There are 2 caveats with this code&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;It only works on SQL 2005+&lt;/li&gt;
&lt;li&gt;It needs DISTINCT in the select statement to run on SQL 2008 (where a bug means the date is reported twice).&lt;/li&gt;
&lt;/ol&gt;
So, having found that the DBCC checks had not occurred, i turned to google :/&lt;br /&gt;
It turns out the client were running SQL 2005 SP2, build 9.00.3042.&lt;br /&gt;
In this build there is a bug re; integrity checks &lt;a href="http://support.microsoft.com/kb/934458"&gt;failing in maintenance plans&lt;/a&gt;. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-4980109090987554064?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x7F6YadnCdHcPm3YIsuEQmSOaQQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x7F6YadnCdHcPm3YIsuEQmSOaQQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x7F6YadnCdHcPm3YIsuEQmSOaQQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x7F6YadnCdHcPm3YIsuEQmSOaQQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/uUDIru9zBEk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/4980109090987554064/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=4980109090987554064&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/4980109090987554064?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/4980109090987554064?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/uUDIru9zBEk/checking-checkdb.html" title="Checking CHECKDB !" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/checking-checkdb.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8ERXw-eip7ImA9WhdXGE8.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-1926374091822434854</id><published>2011-08-31T21:50:00.000+01:00</published><updated>2011-08-31T21:50:04.252+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T21:50:04.252+01:00</app:edited><title>Top Tweets</title><content type="html">Top 3 Tweets today! Linking these to read them later...&lt;br /&gt;
&lt;br /&gt;
Jamie Thomson (&lt;a href="http://twitter.com/#%21/jamiet/"&gt;@jamiet&lt;/a&gt;) &lt;a href="http://twitter.com/#%21/jamiet/status/108811980739063808"&gt;tweets&lt;/a&gt; :&lt;br /&gt;
"&lt;a href="http://consultingblogs.emc.com/davidportas/archive/2006/09/14/Down-with-Primary-Keys_3F00_.aspx"&gt;Down with Primary Keys?&lt;/a&gt;" by David Portas. Always enjoy going back to this article.&lt;br /&gt;
&lt;br /&gt;
Tony Rogerson (&lt;a href="http://twitter.com/#%21/tonyrogerson/"&gt;@tonyrogerson&lt;/a&gt;)  &lt;a href="http://twitter.com/#%21/tonyrogerson/status/108808175024734208"&gt;tweets&lt;/a&gt; :
&lt;br /&gt;
&lt;a href="http://www.informationqualitysolutions.com/FreeStuff/rettigNormalizationPoster.pdf"&gt;Database Design (Normalisation) rules poster&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;


Joesph Sack (&lt;a href="http://twitter.com/#%21/josephsack"&gt;@josephsack&lt;/a&gt;) &lt;a href="http://twitter.com/#%21/josephsack/status/108912802055471104"&gt;tweets&lt;/a&gt; :&lt;br /&gt;
&lt;a href="http://news.cnet.com/8301-10805_3-20099717-75/windows-8-to-directly-support-iso-and-vhd-files/"&gt;Windows 8 to directly support ISO and VHD files&lt;/a&gt; 




&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-1926374091822434854?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/iXHXba4_xdDd-46n62S2VS3YMxk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iXHXba4_xdDd-46n62S2VS3YMxk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/iXHXba4_xdDd-46n62S2VS3YMxk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/iXHXba4_xdDd-46n62S2VS3YMxk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/nwEZ5MPEvzY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/1926374091822434854/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=1926374091822434854&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1926374091822434854?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1926374091822434854?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/nwEZ5MPEvzY/top-tweets.html" title="Top Tweets" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/top-tweets.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AEQHo5eSp7ImA9WhdXGE8.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-7195250808661497894</id><published>2011-08-29T11:27:00.000+01:00</published><updated>2011-08-31T23:28:21.421+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T23:28:21.421+01:00</app:edited><title>Online index rebuilds : Unsupported data types</title><content type="html">I was attempting to rebuild some indexes ONLINE (using SQL 2005 Enterprise) when I got this error.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;Msg 2725, Level 16, State 2, Line 4
Online index operation cannot be performed for index 'PKCI_MyTable_SearchIndex' because the index contains column 'ReportData' of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index, for clustered index it could be any column of the table. In case of drop_existing the column could be part of new or old index. The operation must be performed offline.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
The error tells us what the problem is, i.e. the inability to use certain data types when rebuilding indexes ONLINE. In my case, the offending column was a &lt;a href="http://sqlsolace.blogspot.com/2011/04/deprecated-text-datatype.html"&gt;deprecated TEXT data type&lt;/a&gt;.
Still, it reminded me to audit the database for such columns...&lt;br /&gt;
&lt;br /&gt;
Finding deprecated data types-&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;SELECT
   sys_schemas.Name as [schema_name]
 , sys_tables.Name AS [table_name]
 , sys_columns.Name AS [column_name]
 , sys_types.Name AS [datatype_name]
FROM Sys.Tables sys_tables (nolock)
JOIN Sys.Schemas sys_schemas (nolock)
ON sys_schemas.Schema_Id = sys_tables.Schema_Id
JOIN Sys.Columns sys_columns (nolock)
ON sys_columns.Object_Id = sys_tables.Object_Id
JOIN Sys.Types sys_types (nolock)
ON sys_types.System_Type_Id = sys_columns.System_Type_Id
AND sys_types.Name IN ('text,'ntext','image')
&lt;/pre&gt;
&lt;br /&gt;
See also &lt;a href="http://msdn.microsoft.com/en-us/library/ms143729.aspx"&gt;Deprecated in SQL 2008 R2&lt;/a&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-7195250808661497894?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Sgqyg6gWBs5Cj5DgZpLMm-nvPd4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Sgqyg6gWBs5Cj5DgZpLMm-nvPd4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Sgqyg6gWBs5Cj5DgZpLMm-nvPd4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Sgqyg6gWBs5Cj5DgZpLMm-nvPd4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/97fc66uxHic" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/7195250808661497894/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=7195250808661497894&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7195250808661497894?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7195250808661497894?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/97fc66uxHic/online-index-rebuilds-unsupported-data.html" title="Online index rebuilds : Unsupported data types" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/online-index-rebuilds-unsupported-data.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkABQno7fip7ImA9WhdQGUg.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-2528051326434992972</id><published>2011-08-21T20:55:00.000+01:00</published><updated>2011-08-21T21:32:33.406+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-21T21:32:33.406+01:00</app:edited><title>Cleaning up MSDB</title><content type="html">I've been working extensively with old SQL 2000 instances recently. The majority have been left to fend for themselves without DBA support.
Whilst backups and index maintenance have for the most part been occuring, the msdb databases are bloated (and fragmented). This is due to some missing functionality in SQL 2000 , namely clearing down the history tables. This post summarises my previous ones on MSDB clearup.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
1) Backup History&lt;/div&gt;
&lt;br /&gt;
To determine the date of the oldest backup history record, run this -&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;SELECT TOP 1 backup_start_date FROM msdb.dbo.backupset WITH (NOLOCK) ORDER BY backup_set_id ASC
&lt;/pre&gt;
&lt;br /&gt;
If there is significant history to remove, use the &lt;a href="http://sqlsolace.blogspot.com/2011/07/ultimate-delete-backup-history-script.html"&gt;Ultimate Delete Backup History Script&lt;/a&gt; to remove it.

To prevent it building up again in the future, regularly run (or schedule) -&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;DECLARE @BackupHistoryDeleteDate DATETIME
SET @BackupHistoryDeleteDate = DATEADD(m,-1,GETDATE())
EXEC msdb.dbo.sp_delete_backuphistory @BackupHistoryDeleteDate ;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
2) Agent Job History&lt;/div&gt;
&lt;br /&gt;
To determine the date of the oldest agent history record, use this - 
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;DECLARE @agentstartdate DATETIME
SELECT @agentstartdate = CONVERT(datetime,CONVERT(VARCHAR(8),MIN(Run_date))) from msdb..sysjobhistory WITH (NOLOCK) OPTION (MAXDOP 1)
&lt;/pre&gt;
&lt;br /&gt;
If there is significant history to remove, use the &lt;a href="http://sqlsolace.blogspot.com/2011/06/sql-sysadmin-clear-job-history-nibble.html"&gt;Clear Job History (Nibble Delete) Script&lt;/a&gt; to remove it.&lt;br /&gt;
To prevent it building up again in the future, regularly run (or schedule) - 
&lt;br /&gt;
For SQL 2000 - 
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;DECLARE @JobHistoryDeleteDate DATETIME
SET @JobHistoryDeleteDate = DATEADD(m,-1,GETDATE())
DECLARE @datepart INT
SET @datepart = CONVERT(INT, CONVERT(VARCHAR, @JobHistoryDeleteDate, 112))
DELETE FROM msdb.dbo.sysjobhistory WHERE (run_date &amp;lt; @datepart)
&lt;/pre&gt;
&lt;br /&gt;
For SQL 2005+ you can use sp_purge_jobhistory (it now takes a date parameter), hence regularly run -
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;DECLARE @JobHistoryDeleteDate DATETIME
SET @JobHistoryDeleteDate = DATEADD(m,-1,GETDATE())
EXEC sp_purge_jobhistory @oldest_date = @JobHistoryDeleteDate 
&lt;/pre&gt;
&lt;br /&gt;
You can also set a row limit by using this &lt;a href="http://www.g-productions.nl/index.php?name=sp_jobhistory_row_limiter&amp;amp;version=2005RTM"&gt;registry entry&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
3) Maint Plan History&lt;/div&gt;
&lt;br /&gt;
To determine the date of the oldest maintenance plan record, use this -
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;DECLARE @mpstartdate DATETIME
SELECT @mpstartdate = MIN(end_time) FROM msdb.dbo.sysdbmaintplan_history WITH (NOLOCK) OPTION (MAXDOP 1)
&lt;/pre&gt;
&lt;br /&gt;
If there is significant history to remove, use the &lt;a href="http://sqlsolace.blogspot.com/2011/08/clear-maintenance-plan-history-nibble.html"&gt;Clear Maintenance Plan History (Nibble Delete) Script&lt;/a&gt; to remove it.

To prevent it building up again in the future, regularly run (or schedule) - 
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;DECLARE @MaintPlanHistoryDeleteDate DATETIME
SET @MaintPlanHistoryDeleteDate = DATEADD(m,-1,GETDATE())
DELETE FROM msdb.dbo.sysdbmaintplan_history WHERE (end_time &amp;lt; @MaintPlanHistoryDeleteDate 
&lt;/pre&gt;
&lt;br /&gt;
To keep all 3 tables under control, here is a script I schedule on my SQL 2000 instances, to keep MSDB in shape
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;-- Keep MSDB Tidy
-- This script keeps 3 tables that have a tendency to bloat down to 2 weeks data
-- It also Cycles error logs when it is executed

DECLARE @HistoryDeleteDate DATETIME
SET @HistoryDeleteDate = DATEADD(week,-2,GETDATE())

-- 1) Backup History
EXEC msdb.dbo.sp_delete_backuphistory @HistoryDeleteDate ;

-- 2) Agent Job History
DECLARE @datepart INT
SET @datepart = CONVERT(INT, CONVERT(VARCHAR, @HistoryDeleteDate, 112))
DELETE FROM msdb.dbo.sysjobhistory WHERE (run_date &amp;amp;amp;lt; @datepart)

-- 3) Maint Plan History
DELETE FROM msdb.dbo.sysdbmaintplan_history WHERE (end_time &amp;lt; @HistoryDeleteDate) 

-- 4) Cycle SQL Server Error logs
EXEC master.dbo.sp_cycle_errorlog;
&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-2528051326434992972?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mJwfjixLKGjy2bWYhka7I9f4xH8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mJwfjixLKGjy2bWYhka7I9f4xH8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mJwfjixLKGjy2bWYhka7I9f4xH8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mJwfjixLKGjy2bWYhka7I9f4xH8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/9enmYOwzPLM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/2528051326434992972/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=2528051326434992972&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2528051326434992972?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2528051326434992972?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/9enmYOwzPLM/cleaning-up-msdb.html" title="Cleaning up MSDB" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/cleaning-up-msdb.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQMQ3szcCp7ImA9WhdWEUo.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-8391578796932289162</id><published>2011-08-21T19:45:00.001+01:00</published><updated>2011-09-04T22:39:42.588+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-04T22:39:42.588+01:00</app:edited><title>Clear Maintenance Plan History (nibble delete)</title><content type="html">Similar to &lt;a href="http://sqlsolace.blogspot.com/2007/05/sql-sysadmin-clear-backup-history.html"&gt;Clear Backup History (nibble delete)&lt;/a&gt; and &lt;a href="http://sqlsolace.blogspot.com/2011/06/sql-sysadmin-clear-job-history-nibble.html"&gt;Clear Job History (nibble delete)&lt;/a&gt;, this third script applies the same technique to the maintenance plan history table.  &lt;pre class="sql" name="code"&gt;-- Maintenance Plan History

USE MSDB
GO

DECLARE @OldestJobHistoryDate DATETIME
DECLARE @DaysToLeave INT
DECLARE @DaysToDeleteAtOnce INT
DECLARE @DeleteDate DATETIME
DECLARE @Counter INT
DECLARE @CounterText VARCHAR(30)

SELECT @OldestJobHistoryDate = end_time 
FROM msdb.dbo.sysdbmaintplan_history 
WHERE sequence_id = (select MIN(sequence_id) FROM msdb.dbo.sysdbmaintplan_history )

SELECT @OldestJobHistoryDate
SET @DaysToLeave = 30
SET @DaysToDeleteAtOnce = 1

SELECT @Counter = DATEDIFF(DAY,@OldestJobHistoryDate,GETDATE())

WHILE @Counter &gt;= @DaysToLeave  
BEGIN   
 SET @CounterText = CONVERT(VARCHAR(30),GETDATE(),21) + ' processing ' + CONVERT(VARCHAR(30),DATEADD(DAY, -@Counter,GETDATE()),21)
 SELECT @DeleteDate = CONVERT(VARCHAR(30),DATEADD(DAY, -@Counter,GETDATE()),21) 
 RAISERROR (@CounterText , 10, 1) WITH NOWAIT   
 DELETE FROM msdb.dbo.sysdbmaintplan_history WHERE end_time &lt; @DeleteDate 
 SELECT @Counter = @Counter - @DaysToDeleteAtOnce  
END 
GO

&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-8391578796932289162?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P3lCPxnR6Cu5Gc2nrWwKJNsrGsQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P3lCPxnR6Cu5Gc2nrWwKJNsrGsQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P3lCPxnR6Cu5Gc2nrWwKJNsrGsQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P3lCPxnR6Cu5Gc2nrWwKJNsrGsQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/YxqYtYiZyEI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/8391578796932289162/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=8391578796932289162&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/8391578796932289162?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/8391578796932289162?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/YxqYtYiZyEI/clear-maintenance-plan-history-nibble.html" title="Clear Maintenance Plan History (nibble delete)" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/clear-maintenance-plan-history-nibble.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QEQncycSp7ImA9WhdQFEQ.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-7134688248333658712</id><published>2011-08-16T12:53:00.005+01:00</published><updated>2011-08-16T13:55:03.999+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-16T13:55:03.999+01:00</app:edited><title>Maintenance Plan will not SAVE</title><content type="html">Came across this issue, where a Maintenance Plan would not save...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-_D-9mkQQmL4/TkpZTD9bQ7I/AAAAAAAAAwk/p9lFr26MK6s/s1600/maint_plan_wont_save.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="216" src="http://4.bp.blogspot.com/-_D-9mkQQmL4/TkpZTD9bQ7I/AAAAAAAAAwk/p9lFr26MK6s/s400/maint_plan_wont_save.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Solution :&lt;br /&gt;
&lt;br /&gt;
To resolve this, either apply the latest SQL Service pack&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Open a command prompt, and re-register 2 DLLs -&lt;br /&gt;
&lt;br /&gt;
regsvr32 msxml3.dll&lt;br /&gt;
regsvr32 msxml6.dll
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-7134688248333658712?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Hh8vPALsHgVvaIGNxj42tO80qrc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hh8vPALsHgVvaIGNxj42tO80qrc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Hh8vPALsHgVvaIGNxj42tO80qrc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hh8vPALsHgVvaIGNxj42tO80qrc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/J38jgz5Sev4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/7134688248333658712/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=7134688248333658712&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7134688248333658712?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7134688248333658712?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/J38jgz5Sev4/maintenance-plan-will-not-save.html" title="Maintenance Plan will not SAVE" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-_D-9mkQQmL4/TkpZTD9bQ7I/AAAAAAAAAwk/p9lFr26MK6s/s72-c/maint_plan_wont_save.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/maintenance-plan-will-not-save.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04FSHY9fip7ImA9WhdXGE8.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-1225985237900979278</id><published>2011-08-15T11:45:00.001+01:00</published><updated>2011-08-31T22:25:19.866+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T22:25:19.866+01:00</app:edited><title>Loop : Remove Auto Shrink from all databases!</title><content type="html">SQL 2000 Version :
&lt;pre class="sql" name="code"&gt;
DECLARE @databasename varchar(100)
DECLARE @sqlAlterStatement varchar(500)

DECLARE NastyCursorThing CURSOR READ_ONLY FOR
SELECT Name FROM sysdatabases
WHERE DBID &amp;gt; 4 AND DATABASEPROPERTYEX(name, 'IsAutoShrink') = 1

OPEN NastyCursorThing
FETCH NEXT FROM NastyCursorThing INTO @databasename
WHILE @@FETCH_STATUS = 0
	BEGIN
	SET @sqlAlterStatement ='ALTER DATABASE [' + @databasename + '] SET AUTO_SHRINK OFF WITH NO_WAIT' + CHAR(10)
	print @sqlAlterStatement
	EXEC(@sqlAlterStatement)
	FETCH NEXT FROM NastyCursorThing INTO @databasename
	END

CLOSE NastyCursorThing
DEALLOCATE NastyCursorThing
&lt;/pre&gt;

SQL 2005/2008 Version :
&lt;pre class="sql" name="code"&gt;
DECLARE @databasename varchar(100)
DECLARE @sqlAlterStatement varchar(500)

DECLARE NastyCursorThing CURSOR READ_ONLY FOR
SELECT name FROM sys.databases
WHERE database_id &amp;gt;  4 AND DATABASEPROPERTYEX(name, 'IsAutoShrink') = 1

OPEN NastyCursorThing
FETCH NEXT FROM NastyCursorThing INTO @databasename
WHILE @@FETCH_STATUS = 0
	BEGIN
	SET @sqlAlterStatement ='ALTER DATABASE [' + @databasename + '] SET AUTO_SHRINK OFF WITH NO_WAIT' + CHAR(10)
	print @sqlAlterStatement
	EXEC(@sqlAlterStatement)
	FETCH NEXT FROM NastyCursorThing INTO @databasename
	END

CLOSE NastyCursorThing
DEALLOCATE NastyCursorThing
&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-1225985237900979278?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/W86CahH2mOurfWRiwNMJ0BSvr8w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W86CahH2mOurfWRiwNMJ0BSvr8w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/W86CahH2mOurfWRiwNMJ0BSvr8w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W86CahH2mOurfWRiwNMJ0BSvr8w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/cXPXNqRBwfo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/1225985237900979278/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=1225985237900979278&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1225985237900979278?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1225985237900979278?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/cXPXNqRBwfo/loop-remove-auto-shrink-from-all.html" title="Loop : Remove Auto Shrink from all databases!" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/loop-remove-auto-shrink-from-all.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8MSHwyeip7ImA9WhdQEUk.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-3959043450578783278</id><published>2011-08-12T10:21:00.001+01:00</published><updated>2011-08-12T10:21:29.292+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-12T10:21:29.292+01:00</app:edited><title>Bookmark : How can you tell if an index is REALLY a duplicate?</title><content type="html">&lt;br /&gt;
Another excellent post from Kimberley Tripp...&lt;br /&gt;
sqlskills&amp;nbsp; : &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/UnderstandingDuplicateIndexes.aspx"&gt;How can you tell if an index is REALLY a duplicate? &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-3959043450578783278?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zJMmco5CcdxgipJ6sRNWTwaS9Xo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zJMmco5CcdxgipJ6sRNWTwaS9Xo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zJMmco5CcdxgipJ6sRNWTwaS9Xo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zJMmco5CcdxgipJ6sRNWTwaS9Xo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/5OajTox27H8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/3959043450578783278/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=3959043450578783278&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/3959043450578783278?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/3959043450578783278?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/5OajTox27H8/bookmark-how-can-you-tell-if-index-is.html" title="Bookmark : How can you tell if an index is REALLY a duplicate?" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/bookmark-how-can-you-tell-if-index-is.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGRno4fyp7ImA9WhdXGE8.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-9047442255432877700</id><published>2011-08-04T10:16:00.000+01:00</published><updated>2011-08-31T22:17:07.437+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T22:17:07.437+01:00</app:edited><title>SQL Server Support Dates</title><content type="html">As an exercise to see how up to date clients are with patching, I produced the following list.&lt;br /&gt;
So, (as of August 2011) - &lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: blue;"&gt;SQL 2000&lt;/span&gt; (yes some organisations still have it)&lt;br /&gt;
&lt;ul style="color: red;"&gt;
&lt;li&gt;SP4 Released May 2005. Support ended April 2008&lt;/li&gt;
&lt;li&gt;SP3 Released Jan 2003. Support ended July 2007&lt;/li&gt;
&lt;li&gt;SP2 Released Nov 2001. Support ended Apr 3003&lt;/li&gt;
&lt;li&gt;SP1 Released Jun 2001. Support ended Feb 2002&lt;/li&gt;
&lt;li&gt;RTM Released Nov 2000. Support ended Dec 2001&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
SQL 2005 &lt;/div&gt;
&lt;ul&gt;
&lt;li style="color: blue;"&gt;SP4 + Updates (Build &amp;gt; 9.0.00.5254). Current.&lt;/li&gt;
&lt;li style="color: red;"&gt;SP4 Released Dec 2010. Support ended April 2011.&lt;/li&gt;
&lt;li style="color: red;"&gt;SP3 Released Nov 2008. Support ended Apr 2011.&lt;/li&gt;
&lt;li style="color: red;"&gt;SP2 Released Jan 2007. Support ended Jan 2010.&lt;/li&gt;
&lt;li style="color: red;"&gt;SP1 Released Apr 2006. Support ended Apr 2008.&lt;/li&gt;
&lt;li style="color: red;"&gt;RTM Released Jan 2006. Support ended July 2007.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
SQL 2008 &lt;/div&gt;
&lt;ul&gt;
&lt;li style="color: blue;"&gt;SP2 Released Sep 2010. Current.&lt;/li&gt;
&lt;li style="color: blue;"&gt;SP1 Released Apr 2009. Current. Support ends Oct 2011&lt;/li&gt;
&lt;li style="color: red;"&gt;RTM Released Aug 2008. Support ended Apr 2010&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
SQL 2008 R2&lt;/div&gt;
&lt;ul style="color: blue;"&gt;
&lt;li&gt;RTM Released Apr 2010. Current. Support ends Jan 2014&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
Links&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/psssql/archive/2010/01/08/important-sql-server-and-windows-end-of-support-dates-you-should-know-about.aspx"&gt;Important SQL Server and Windows “End of Support” Dates you should know about….&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://sqlserverpedia.com/wiki/SQL_Server_2000_Release_Date_Calendar"&gt;SQL 2000 Release Date Calendar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://support.microsoft.com/kb/894905"&gt;Cumulative list of the hotfixes that are available for SQL Server 2000 SP4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://support.microsoft.com/gp/lifesupsps"&gt;Lifecycle Supported Service Packs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-9047442255432877700?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Cn2Ja5hi9ebjP8-qRTm7VSuhmSg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cn2Ja5hi9ebjP8-qRTm7VSuhmSg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Cn2Ja5hi9ebjP8-qRTm7VSuhmSg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cn2Ja5hi9ebjP8-qRTm7VSuhmSg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/e7opvcfNNtA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/9047442255432877700/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=9047442255432877700&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/9047442255432877700?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/9047442255432877700?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/e7opvcfNNtA/sql-server-support-dates.html" title="SQL Server Support Dates" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/08/sql-server-support-dates.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08GR3w4fSp7ImA9WhRSFU8.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-2937080531972893584</id><published>2011-07-29T09:08:00.000+01:00</published><updated>2011-11-17T09:23:46.235Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-17T09:23:46.235Z</app:edited><title>SQL Management Studio : Start Clean!</title><content type="html">When managing multiple servers I find this to be an essential tip.&lt;br /&gt;
&lt;br /&gt;
From the menu bar select 'Tools &amp;gt; Options '.&lt;br /&gt;
Then from the 'General' pane (shown below), select 'Open empty environment' in the 'At Startup' drop down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-quy2SrnzAXw/TsTPDzUBMYI/AAAAAAAAAxY/NqeUYc2I8mw/s1600/empty_environment.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://3.bp.blogspot.com/-quy2SrnzAXw/TsTPDzUBMYI/AAAAAAAAAxY/NqeUYc2I8mw/s400/empty_environment.JPG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This means you will no longer be prompted to connect to the last server you were using when you start Management Studio.&lt;br /&gt;
&lt;br /&gt;
Use this together with the other &lt;a href="http://sqlsolace.blogspot.com/p/management-studio.html"&gt;SSMS speedup tips listed here&lt;/a&gt; to speed up your Management Studio experience. &lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-2937080531972893584?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ASkbPDMv76tQVLyqGmkr_VCRLwM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ASkbPDMv76tQVLyqGmkr_VCRLwM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ASkbPDMv76tQVLyqGmkr_VCRLwM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ASkbPDMv76tQVLyqGmkr_VCRLwM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/SE97J_Y9ghU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/2937080531972893584/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=2937080531972893584&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2937080531972893584?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/2937080531972893584?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/SE97J_Y9ghU/sql-management-studio-start-clean.html" title="SQL Management Studio : Start Clean!" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-quy2SrnzAXw/TsTPDzUBMYI/AAAAAAAAAxY/NqeUYc2I8mw/s72-c/empty_environment.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/11/sql-management-studio-start-clean.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QFSHc6eip7ImA9WhRRGUg.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-7146837313224848217</id><published>2011-07-26T23:26:00.000+01:00</published><updated>2011-12-03T23:35:19.912Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-03T23:35:19.912Z</app:edited><title>File Fragmentation : Contig.exe</title><content type="html">Contig is a free command line defragmentation tool. &lt;br /&gt;Now on Microsoft Technet it was formerly part of the sysinternals project.&lt;br /&gt;It can be used to analyze fragmentation without performing any defragmentation with the -a switch.&lt;br /&gt;The advantage of the tool is that you can specify individual files to analyse. You do not have to wait on results for an entire drive to be analysed.&lt;br /&gt;Running Contig without parameters tells you how to use it -&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data&amp;gt;&lt;/span&gt;&lt;span style="color: red;"&gt;contig&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Contig v1.6 - Makes files contiguous&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Copyright (C) 1998-2010 Mark Russinovich&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Sysinternals - www.sysinternals.com&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Contig is a utility that defragments a specified file or files.&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Use it to optimize execution of your frequently used files.&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Usage:&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;contig [-a] [-s] [-q] [-v] [existing file]&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;or contig [-f] [-q] [-v] [drive:]&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;or contig [-v] -n [new file] [new file length]&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;-a: Analyze fragmentation&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;-f: Analyze free space fragmentation&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;-q: Quiet mode&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;-s: Recurse subdirectories&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;-v: Verbose&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Contig can also analyze and defragment the following NTFS metadata files:&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$Mft&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$LogFile&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$Volume&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$AttrDef&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$Bitmap&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$Boot&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$BadClus&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$Secure&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$UpCase&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;$Extend&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br /&gt;To view fragmentation, use the -a switch like this...&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data&amp;gt;&lt;span style="color: red;"&gt;contig -a *.mdf&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Contig v1.6 - Makes files contiguous&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Copyright (C) 1998-2010 Mark Russinovich&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Sysinternals - www.sysinternals.com&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Accounting.MDF is defragmented&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Accounting_UAT.MDF is in 14 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\AuditPC.mdf is in 7 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\DataStore.mdf is in 34 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\FakeDb.MDF is in 5 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Personel.mdf is in 4 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\master.mdf is in 3 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\model.mdf is in 2 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\msdbdata.mdf is in 5182 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\northwnd.mdf is in 2 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\pubs.mdf is in 2 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Software.mdf is in 4 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Software_UAT.mdf is in 9 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Telecoms.mdf is in 17 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\tempdb.mdf is in 42 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\tools.mdf is in 5 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;D:\MSSQL\Data\Weblogs.MDF is in 89 fragments&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Summary:&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Number of files processed : 17&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Average fragmentation : 176.03 frags/file&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Download Link : &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb897428"&gt;http://technet.microsoft.com/en-us/sysinternals/bb897428&lt;/a&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-7146837313224848217?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rrIL7POYJOO4485p3RS3b0ofV8Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rrIL7POYJOO4485p3RS3b0ofV8Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rrIL7POYJOO4485p3RS3b0ofV8Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rrIL7POYJOO4485p3RS3b0ofV8Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/eCVKy9Kve2M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/7146837313224848217/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=7146837313224848217&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7146837313224848217?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/7146837313224848217?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/eCVKy9Kve2M/file-fragmentation-contigexe.html" title="File Fragmentation : Contig.exe" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/07/file-fragmentation-contigexe.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ABR3k_fSp7ImA9WhRRGUg.&quot;"><id>tag:blogger.com,1999:blog-2453693540149032389.post-1287104502450581387</id><published>2011-07-19T23:38:00.000+01:00</published><updated>2011-12-03T23:42:36.745Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-03T23:42:36.745Z</app:edited><title>SQL Server : Auditing disk configuration</title><content type="html">&lt;br /&gt;Disks or SAN volumnes presented for SQL Server are best &lt;a href="http://sqlsolace.blogspot.com/2008/06/disk-alignment-for-sql-server.html"&gt;formatted and aligned&lt;/a&gt; for optimal use.&lt;br /&gt;
Auditing an existing SQL server however, you will want to check whether this is the case.&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Checking Cluster Size (File Allocation unit)&lt;/b&gt;&lt;br /&gt;Use FSUTIL, like this -&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;C:\&amp;gt;&lt;span style="color: red;"&gt;fsutil fsinfo ntfsinfo s:&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;NTFS Volume Serial Number :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x385ed1bb5ed171dc&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Version :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.1&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Number Sectors :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000207fcb54&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Total Clusters :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000040ff96a&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Free Clusters&amp;nbsp; :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000017b10dc&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Total Reserved :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x0000000000000000&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Bytes Per Sector&amp;nbsp; :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 512&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Bytes Per Cluster :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4096&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Bytes Per FileRecord Segment&amp;nbsp;&amp;nbsp;&amp;nbsp; : 1024&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Clusters Per FileRecord Segment : 0&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Mft Valid Data Length :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x000000022cfc0000&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Mft Start Lcn&amp;nbsp; :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000000c0000&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Mft2 Start Lcn :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x000000000207fcb5&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Mft Zone Start :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000002a9720&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Mft Zone End&amp;nbsp;&amp;nbsp; :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000008dff40&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br /&gt;Bytes Per Cluster is the figure we are after. In the example above it is 4096 bytes (4K). This is NTFS default and is less than optimal for SQL Server (64K reads &amp;amp; writes).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Checking Partition Alignment &lt;/b&gt;&lt;br /&gt;There are 2 methods of doing this. The first is WMIC -&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;C:\&amp;gt;&lt;span style="color: red;"&gt;wmic partition get BlockSize, StartingOffset, Name, Index&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;BlockSize&amp;nbsp; Index&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartingOffset&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #0, Partition #0&amp;nbsp; 16384&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #1, Partition #0&amp;nbsp; 32256&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #2, Partition #0&amp;nbsp; 32256&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #3, Partition #0&amp;nbsp; 32256&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #4, Partition #0&amp;nbsp; 32256&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #5, Partition #0&amp;nbsp; 32256&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br /&gt;If WMIC is not available, DISKPART commands can reveal how partition alignment is configured.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;C:\&amp;gt; &lt;span style="color: red;"&gt;DISKPART&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;DISKPART&amp;gt; &lt;span style="color: red;"&gt;select volume s:&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Volume 5 is the selected volume.&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;DISKPART&amp;gt; &lt;span style="color: red;"&gt;list partition&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;Partition ### Type Size Offset&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;------------- ---------------- ------- -------&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;* Partition 1 Primary 37 GB 32 KB&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;span style="color: blue;"&gt;DISKPART&amp;gt; &lt;span style="color: red;"&gt;exit&lt;/span&gt;&lt;/span&gt;&lt;br style="color: blue;" /&gt;&lt;br style="color: blue;" /&gt;&lt;br /&gt;In the examples above the majority of partitions are aligned to 32K (32256 bytes), again less than ideal.&lt;br /&gt;&lt;br /&gt;See &lt;a href="http://sqlsolace.blogspot.com/2008/06/disk-alignment-for-sql-server.html"&gt;Disk Formatting &amp;amp; Partition Alignment for SQL Server&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2453693540149032389-1287104502450581387?l=sqlsolace.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PUtvoVxtqkIol3nDEyuoHeLuu_s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PUtvoVxtqkIol3nDEyuoHeLuu_s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PUtvoVxtqkIol3nDEyuoHeLuu_s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PUtvoVxtqkIol3nDEyuoHeLuu_s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/SqlSolace/~4/kdrknyVquiQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://sqlsolace.blogspot.com/feeds/1287104502450581387/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=2453693540149032389&amp;postID=1287104502450581387&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1287104502450581387?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/2453693540149032389/posts/default/1287104502450581387?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SqlSolace/~3/kdrknyVquiQ/sql-server-auditing-disk-configuration.html" title="SQL Server : Auditing disk configuration" /><author><name>r5d4</name><uri>http://www.blogger.com/profile/09999231147372917249</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="32" src="http://3.bp.blogspot.com/_rnmXZq5ccGo/TDGsyKZffxI/AAAAAAAAApU/vi8HhGcZ_5c/S220/r5d4-2.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://sqlsolace.blogspot.com/2011/07/sql-server-auditing-disk-configuration.html</feedburner:origLink></entry></feed>

