﻿<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>Strate SQL</title>
	<updated>2010-07-29T15:33:57Z</updated>
	<id>http://stratesql.com/atom.aspx</id>
	<link href="http://stratesql.com/atom.aspx" rel="self" type="application/rss+xml" />
	<link href="http://stratesql.com" rel="alternate" type="application/rss+xml" />
	<generator uri="http://app.onlinequickblog.com/" version="2.0">Quick Blogcast</generator>
	<entry>
		<title>Moving to Blog JasonStrate.com</title>
		<link rel="alternate" href="http://stratesql.com/2009/12/20/moving-to-blog-jasonstratecom.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-12-20:03b0a587-c1a8-4e2c-afde-fbf905f2aa58</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<updated>2009-12-20T22:05:00Z</updated>
		<published>2009-12-20T22:05:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/10224_283023655160_790425160_8717400_697378_n_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 0px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="10224_283023655160_790425160_8717400_697378_n" border="0" alt="10224_283023655160_790425160_8717400_697378_n" align="left" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/10224_283023655160_790425160_8717400_697378_n_thumb.jpg" width="221" height="260" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I wanted to let everyone that comes here know that after some work, I’ve switched from posting to &lt;a href="http://www.stratesql.com"&gt;www.stratesql.com&lt;/a&gt; to blogging at &lt;a href="http://www.jasonstrate.com"&gt;www.jasonstrate.com&lt;/a&gt;.&amp;#160; This is mainly because I wanted to be able to have more flexibility in putting posts together and wanted some features that are not available with the software I was previously using.&lt;/p&gt;  &lt;p&gt;If you are getting this message in your RSS feed for my site, please change the RSS subscription from StrateSQL to &lt;a title="http://feeds.feedburner.com/StrateSql" href="http://feeds.feedburner.com/StrateSql"&gt;http://feeds.feedburner.com/StrateSql&lt;/a&gt;.&amp;#160; This will keep up with the subscription that has the current site of choice always coming to you and lets you avoid finding this message in your feed in the event I make similar changes a couple years down the road.&lt;/p&gt;  &lt;p&gt;For posterity, this site will stay up.&amp;#160; For completeness, though, all of the blog content has been moved to &lt;a href="http://www.jasonstrate.com"&gt;www.jasonstrate.com&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you’d like to keep up with me in other avenues, I can also be found in these places:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Facebook – &lt;a href="http://www.facebook.com/stratesql"&gt;www.facebook.com/stratesql&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;LinkedIn - &lt;a title="http://www.linkedin.com/in/jasonstrate" href="http://www.linkedin.com/in/jasonstrate"&gt;http://www.linkedin.com/in/jasonstrate&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Twitter – &lt;a href="http://www.twitter.com/stratesql"&gt;www.twitter.com/stratesql&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Friendfeed - &lt;a title="http://friendfeed.com/h4ppyd4y" href="http://friendfeed.com/h4ppyd4y"&gt;http://friendfeed.com/h4ppyd4y&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;Delicious - &lt;a title="http://delicious.com/StrateSQL" href="http://delicious.com/StrateSQL"&gt;http://delicious.com/StrateSQL&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;</content>
	</entry>
	<entry>
		<title>December PASSMN Meeting This Week</title>
		<link rel="alternate" href="http://stratesql.com/2009/12/06/december-passmn-meeting-this-week.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-12-06:045e8184-344e-47e1-905a-37db2cd49b94</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<updated>2009-12-06T23:00:00Z</updated>
		<published>2009-12-06T23:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/harddisk-christmas-tree_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="harddisk-christmas-tree" border="0" alt="harddisk-christmas-tree" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/harddisk-christmas-tree_thumb.jpg" width="147" height="204" /&gt;&lt;/a&gt; In case you missed the last reminder or hadn’t heard.&amp;#160; We are having a PASSMN meeting in December this year.&amp;#160; Check out the event details below and take a chance to learn new things with some of your fellow SQL Server professionals.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1984"&gt;Don't Wait! Consolidate on 2008!&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;December 8th      &lt;br /&gt;5:00 PM Networking &amp;amp; Social       &lt;br /&gt;5:15 PM – 5:30 PM Meet the new PASSMN Board       &lt;br /&gt;5:30 PM - 7:00 PM Presentation&lt;/p&gt;    &lt;p&gt;8300 Norman Center Drive      &lt;br /&gt;9th Floor       &lt;br /&gt;Bloomington, MN&amp;#160; 55437&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Don't Wait! Consolidate on 2008!&lt;/h3&gt;  &lt;p&gt;&lt;strong&gt;Speaker: Rick Heiges&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;SQL Server 2008 introduces features such as Resource Governor, Compression, Virtualization, and Policy-Based Management that help organizations consolidate to keep TCO down. A discussion of features since 2000 that enable consolidation along with the limitations of each will be presented. Real-world stories will enhance this discussion. The session will also encompass SQL Server on Virtual Machines.&lt;/p&gt;  &lt;p&gt;Rick Heiges&amp;#160; is a SQL Server MVP and a Sr. Solutions Consultant with Scalability Experts working with customers on solutions within the SQL Server environment and educating users on SQL Server by speaking at user groups, conferences, labs, and road shows across the USA, Europe, and Africa. He holds an MBA and a M.S. in MIS as well as a B.S. in Computer Science. In addition, he also has attained MCTS:SQL2005 and MCITP&lt;img src="http://stratesql.com/emoticons/laugh.png" border="0" /&gt;BA certifications. His career has dealt with a wide array of job responsibilities including professor, developer, trainer, database administrator, and project manager/leader. Rick has been involved with PASS since the spring of 2001 and started up an Official PASS SQL Server user group in North Carolina as well as authoring several articles on for the PASS technical journal, the SQL Server Standard. Rick has served on the PASS Board of Directors since January 2003. You can read his blog at &lt;a href="http://www.sqlblog.com"&gt;www.sqlblog.com&lt;/a&gt; and contact him at &lt;a href="mailto:atrheiges@scalabilityexperts.com"&gt;rheiges@scalabilityexperts.com&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Show Up And Network&lt;/h3&gt;  &lt;p&gt;I’d like to encourage everyone to come down and meet someone new at the user group meeting this month.&amp;#160; Walk up to someone you’ve not met before and introduce yourself.&amp;#160; Share a business card.&amp;#160; Make a contact.&amp;#160; Who knows!&amp;#160; The next person you meet just might be a new client or have the answer to solve your next production issue.&lt;/p&gt;  &lt;p&gt;Also, with the regular monthly swag, we’ll be giving away CDs from PASS Summit 2008.&amp;#160; This is a library of over 160 sessions covering database administration, development, business development and professional development.&amp;#160; A huge resource of materials that I personally get a lot of benefit out of.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Does Your Stored Procedure Grant Itself Permissions?</title>
		<link rel="alternate" href="http://stratesql.com/2009/12/03/does-your-stored-procedure-grant-itself-permissions.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-12-03:cfa64a04-f97b-4f30-b9c1-b8e24e4d1eb9</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DBA" />
		<updated>2009-12-03T13:00:00Z</updated>
		<published>2009-12-03T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/hamster-wheel_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="hamster-wheel" border="0" alt="hamster-wheel" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/hamster-wheel_thumb.jpg" width="109" height="159" /&gt;&lt;/a&gt; It’s a very good question. One that might not seem to insidious. Nothing that should be able to bring down the system and cause failures. Or will it?&lt;/p&gt;  &lt;p&gt;I’ve been to a number of clients and done it myself before where I start to check out a stored procedure with some performance issues and sitting all pretty at the bottom is a GRANT EXEC statement. When I script out the stored procedure I get something similar to the following:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; dbo.FooGetTableA&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    (&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(4)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    )&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; Column1 &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.TableA&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; Column2 = @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;GRANT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; dbo.FooGetTableA &lt;span style="color: #0000ff"&gt;TO&lt;/span&gt; ApplicationRole&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;GO&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;But if you look carefully, there is something missing, or one could say included that shouldn’t be.&amp;#160; Look again if you don’t see it. It’s hidden in plain sight.&amp;#160; The permissions for the procedure are included in the body of the stored procedure.&amp;#160; When the procedure was written, someone thought ahead to add permissions to the script but forgot the GO statement between the stored procedure &lt;/p&gt;

&lt;p&gt;In a better world this script would have looked like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; dbo.FooGetTableA&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    (&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(4)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    )&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; Column1 &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.TableA&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; Column2 = @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;GRANT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; dbo.FooGetTableA &lt;span style="color: #0000ff"&gt;TO&lt;/span&gt; ApplicationRole&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;GO&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;h4&gt;It’s Just a Permission Statement&lt;/h4&gt;

&lt;p&gt;Who cares, right?&amp;#160; So you are assigning some permissions every time that procedure executes.&amp;#160; What harm could possibly come of it.&amp;#160; I’ve seen this so many times and usually it’s one of things I’ll point out and say, “oops, you should take care of that”.&amp;#160; When I should be saying, “yeah, fellas.&amp;#160; You’ve got a time bomb there waiting for your business to take off.”&lt;/p&gt;

&lt;p&gt;And the time bomb is deadlocks.&amp;#160; Completely preventable deadlocks.&lt;/p&gt;

&lt;p&gt;If you have procedures that grant themselves permissions, then as the volume of activity in your database increases you may start to see deadlock graphs similar to the following:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;deadlock-list&lt;br /&gt; deadlock victim=process30108bac8&lt;br /&gt;  process-list&lt;br /&gt;   process id=processec55dd68 taskpriority=0 logused=0 waitresource=METADATA: database_id = 10 PERMISSIONS(&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; = 1, major_id = 219199881) waittime=15000 ownerId=746424569 transactionname=&lt;span style="color: #0000ff"&gt;Load&lt;/span&gt; Permission &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; Cache lasttranstarted=2009-10-22T23:06:59.287 XDES=0x3712a8e98 lockMode=Sch-S schedulerid=1 kpid=5832 status=suspended spid=157 sbid=2 ecid=0 priority=0 transcount=1 lastbatchstarted=2009-10-22T23:06:59.287 lastbatchcompleted=2009-10-22T23:06:59.280 clientapp=.Net SqlClient &lt;span style="color: #0000ff"&gt;Data&lt;/span&gt; Provider hostname=PRDWB0111 hostpid=5640 loginname=portaluser isolationlevel=serializable (4) xactid=746424394 currentdb=10 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056&lt;br /&gt;    executionStack&lt;br /&gt;     frame procname=AdventureWorks2008.dbo.FooGetTableA line=1 sqlhandle=0x03000a0089b9100d0e527800669c00000100000000000000&lt;br /&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; dbo.FooGetTableA&lt;br /&gt;    (&lt;br /&gt;    @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(4)&lt;br /&gt;    )&lt;br /&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; Column1 &lt;br /&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.TableA&lt;br /&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; Column2 = @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GRANT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; dbo.FooGetTableA &lt;span style="color: #0000ff"&gt;TO&lt;/span&gt; ApplicationRole&lt;br /&gt;    inputbuf&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Proc&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Database&lt;/span&gt; Id = 10 &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; Id = 219199881]    &lt;br /&gt;   process id=process30108bac8 taskpriority=0 logused=0 waitresource=METADATA: database_id = 10 PERMISSIONS(&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; = 1, major_id = 1746157316) waittime=2125 ownerId=746479249 transactionname=&lt;span style="color: #0000ff"&gt;Load&lt;/span&gt; Permission &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; Cache lasttranstarted=2009-10-22T23:07:12.180 XDES=0x3786c61c8 lockMode=Sch-S schedulerid=3 kpid=4048 status=suspended spid=69 sbid=2 ecid=0 priority=0 transcount=1 lastbatchstarted=2009-10-22T23:07:12.180 lastbatchcompleted=2009-10-22T23:07:12.167 clientapp=.Net SqlClient &lt;span style="color: #0000ff"&gt;Data&lt;/span&gt; Provider hostname=AMBER hostpid=568 loginname=portaluser isolationlevel=serializable (4) xactid=746372404 currentdb=10 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056&lt;br /&gt;    executionStack&lt;br /&gt;     frame procname=AdventureWorks2008.dbo.FooGetTableB line=1 sqlhandle=0x03000a00043f146882564201a09b00000100000000000000&lt;br /&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; dbo.FooGetTableB&lt;br /&gt;    (&lt;br /&gt;    @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(4)&lt;br /&gt;    )&lt;br /&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; Column1 &lt;br /&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.TableB&lt;br /&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; Column2 = @&lt;span style="color: #0000ff"&gt;Parameter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GRANT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; dbo.FooGetTableB &lt;span style="color: #0000ff"&gt;TO&lt;/span&gt; ApplicationRole&lt;br /&gt;    inputbuf&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Proc&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Database&lt;/span&gt; Id = 10 &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; Id = 1746157316]    &lt;br /&gt;  resource-list&lt;br /&gt;   metadatalock subresource=PERMISSIONS classid=&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; = 1, major_id = 219199881 dbid=10 id=lock4153ec880 mode=Sch-M&lt;br /&gt;    owner-list&lt;br /&gt;     owner id=process30108bac8 mode=Sch-M&lt;br /&gt;    waiter-list&lt;br /&gt;     waiter id=processec55dd68 mode=Sch-S requestType=wait&lt;br /&gt;   metadatalock subresource=PERMISSIONS classid=&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; = 1, major_id = 1746157316 dbid=10 id=lock415451780 mode=Sch-M&lt;br /&gt;    owner-list&lt;br /&gt;     owner id=processec55dd68 mode=Sch-M&lt;br /&gt;    waiter-list&lt;br /&gt;     waiter id=process30108bac8 mode=Sch-S requestType=wait&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;h4&gt;Breaking It Down&lt;/h4&gt;

&lt;p&gt;When I first started looking at these there are a few things I noted right away:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The procedures were access completely different tables with no common objects between them.&amp;#160; In the sample above there is TableA and TableB and no relationship. &lt;/li&gt;

  &lt;li&gt;Looking at each of the processes in the deadlock both of them have the following attributes 
    &lt;ol&gt;
      &lt;li&gt;waitresource=METADATA: database_id = 10 PERMISSIONS &lt;/li&gt;

      &lt;li&gt;transactionname=Load Permission Object Cache &lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So nothing in common and a deadlock on a metadata resource for permissions.&amp;#160; This made me start to re-think how the two procedures were related.&amp;#160; With a metadata resource wait, there seems to be an issue above the data in the table.&amp;#160; Since both procedures point to the Load Permission Object Cache, maybe there is an issue there.&lt;/p&gt;

&lt;p&gt;If you take a look, each of the procedures has a GRANT EXEC permission statement in it.&amp;#160; This is the area of commonality and where the two executions deadlocked.&amp;#160; Removing the GRANT EXEC permissions statements stop this deadlock from occurring.&lt;/p&gt;

&lt;p&gt;After going through and removing these permission statements from a number of procedures that had this issue, all of the deadlocks with these types of issues disappeared.&amp;#160; And it is smooth sailing once again.&lt;/p&gt;

&lt;h4&gt;Cautionary Tale&lt;/h4&gt;

&lt;p&gt;Hopefully this is a scenario that only I’ve run into.&amp;#160; But if it’s not then this should serve as a reminder that little details that seem like a little non-issue, could be the crack that breaks the damn when there’s enough water behind it.&amp;#160; The thing that gets you on this issue is that it isn’t until execution start to really grow before it pops out and it will only hit when you’re the busiest.&amp;#160; This is something I’ll be keeping an eye out for in the future and I’d recommend the same for others as well.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Deadlocks on exchangeEvent and threadpool</title>
		<link rel="alternate" href="http://stratesql.com/2009/12/02/deadlocks-on-exchangeevent-and-threadpool.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-12-02:27753b6e-8db4-4898-a8de-4b87e9aaa2e6</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="Parallelism" />
		<updated>2009-12-02T13:00:00Z</updated>
		<published>2009-12-02T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/80771711_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="80771711" border="0" alt="80771711" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/80771711_thumb.jpg" width="157" height="120" /&gt;&lt;/a&gt; I got to work with deadlocks quite a bit recently.&amp;#160; There were quite a few interesting ones that came up that I had the chance to research.&amp;#160; Since I like easy, I’ll start with the one that I forgot to grab the deadlock details for.&lt;/p&gt;  &lt;p&gt;Well, maybe not all of the details… in this case as the title states I was looking at deadlocks with the events exchangeEvent and threadpool.&amp;#160; I managed to come across a &lt;a href="http://blogs.msdn.com/bartd/archive/2008/09/24/today-s-annoyingly-unwieldy-term-intra-query-parallel-thread-deadlocks.aspx"&gt;post from Bart Duncan that went through and deciphered this deadlock&lt;/a&gt;.&amp;#160; The long and the short of it… parallelism deadlocks.&lt;/p&gt;  &lt;p&gt;Bart does a better job explaining this than I can do here, especially since I didn’t take the time to grab the deadlock details for review.&amp;#160; Maybe I’ll have that one the next one…&lt;/p&gt;  &lt;p&gt;Fortunately, a large part of the issue that I was reviewing for the client had to do with parallelism and so solving this issue actually occurred as a side effect of dealing with parallelism issues.&amp;#160; But I will share my little secret that I used to resolve this and most of the parallelism…&lt;/p&gt;  &lt;h4&gt;Indexes!!&lt;/h4&gt;  &lt;p&gt;There I said it.&amp;#160; True, you can have too many indexes.&amp;#160; But no indexes is too few.&amp;#160; No clustered indexes can lead to too many scans.&amp;#160; I could pulpit here on indexes and making sure that you have them, but I’ll save that for another time.&lt;/p&gt;  &lt;p&gt;Overall, I used Bart’s Workaround #1.&amp;#160; Hopefully this helps… direct you to a post that is more prescriptive.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>December PASSMN Meeting</title>
		<link rel="alternate" href="http://stratesql.com/2009/11/18/december-passmn-meeting.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-11-18:569e7319-9761-48a3-9f22-d9e8f8c2c50b</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SQL 2005" />
		<category term="SQLServer" />
		<category term="MNSSUG" />
		<category term="SQL 2008" />
		<updated>2009-11-18T19:52:00Z</updated>
		<published>2009-11-18T19:52:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/harddisk-christmas-tree_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="harddisk-christmas-tree" border="0" alt="harddisk-christmas-tree" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/harddisk-christmas-tree_thumb.jpg" width="176" height="244" /&gt;&lt;/a&gt; Hopefully everyone caught the news that the November PASSMN meeting was cancelled.&amp;#160; We had some scheduling conflicts and things didn’t come together as expected.&amp;#160; But to make up for that, we’ve managed to snag a speaker and room for the beginning of December.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1984"&gt;Don't Wait! Consolidate on 2008!&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;December 8th      &lt;br /&gt;5:00 PM Networking &amp;amp; Social       &lt;br /&gt;5:15 PM – 5:30 PM Meet the new PASSMN Board       &lt;br /&gt;5:30 PM - 7:00 PM Presentation&lt;/p&gt;    &lt;p&gt;8300 Norman Center Drive      &lt;br /&gt;9th Floor       &lt;br /&gt;Bloomington, MN&amp;#160; 55437&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Don't Wait! Consolidate on 2008!&lt;/h3&gt;  &lt;p&gt;&lt;strong&gt;Speaker: Rick Heiges&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;SQL Server 2008 introduces features such as Resource Governor, Compression, Virtualization, and Policy-Based Management that help organizations consolidate to keep TCO down. A discussion of features since 2000 that enable consolidation along with the limitations of each will be presented. Real-world stories will enhance this discussion. The session will also encompass SQL Server on Virtual Machines.&lt;/p&gt;  &lt;p&gt;Rick Heiges&amp;#160; is a SQL Server MVP and a Sr. Solutions Consultant with Scalability Experts working with customers on solutions within the SQL Server environment and educating users on SQL Server by speaking at user groups, conferences, labs, and road shows across the USA, Europe, and Africa. He holds an MBA and a M.S. in MIS as well as a B.S. in Computer Science. In addition, he also has attained MCTS:SQL2005 and MCITP&lt;img src="http://stratesql.com/emoticons/laugh.png" border="0" /&gt;BA certifications. His career has dealt with a wide array of job responsibilities including professor, developer, trainer, database administrator, and project manager/leader. Rick has been involved with PASS since the spring of 2001 and started up an Official PASS SQL Server user group in North Carolina as well as authoring several articles on for the PASS technical journal, the SQL Server Standard. Rick has served on the PASS Board of Directors since January 2003. You can read his blog at &lt;a href="http://www.sqlblog.com"&gt;www.sqlblog.com&lt;/a&gt; and contact him at &lt;a href="mailto:atrheiges@scalabilityexperts.com"&gt;rheiges@scalabilityexperts.com&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Show Up And Network&lt;/h3&gt;  &lt;p&gt;I’d like to encourage everyone to come down and meet someone new at the user group meeting this month.&amp;#160; Walk up to someone you’ve not met before and introduce yourself.&amp;#160; Share a business card.&amp;#160; Make a contact.&amp;#160; Who knows!&amp;#160; The next person you meet just might be a new client or have the answer to solve your next production issue.&lt;/p&gt;  &lt;p&gt;Also, with the regular monthly swag, we’ll be giving away CDs from PASS Summit 2008.&amp;#160; This is a library of over 160 sessions covering database administration, development, business development and professional development.&amp;#160; A huge resource of materials that I personally get a lot of benefit out of.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>If You Don&amp;rsquo;t Know Where You&amp;rsquo;ve Been&amp;hellip;</title>
		<link rel="alternate" href="http://stratesql.com/2009/11/18/if-you-donrsquot-know-where-yoursquove-beenhellip.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-11-18:76ba7831-4abc-42d0-98f9-f37c4d7c667a</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2005" />
		<category term="DBADiagnostics" />
		<category term="Performance Tuning" />
		<category term="SQL 2008" />
		<updated>2009-11-18T15:00:00Z</updated>
		<published>2009-11-18T15:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/virginia-history_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="virginia-history" border="0" alt="virginia-history" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/virginia-history_thumb.jpg" width="205" height="165" /&gt;&lt;/a&gt; If you don’t know where you’ve been, how can you expect to know where you are going.&amp;#160; Seems like such a simple little line and I’m sure many of us can look at history, politicians, and maybe that restaurant review that you didn’t heed when it comes to this line.&amp;#160; But this also applies to DBAs and more specifically to SQL Server.&lt;/p&gt;  &lt;p&gt;In much the same way… if you don’t know what’s been happening in your SQL Server environment, you won’t know how to resolve performance problems that have occurred on the server.&amp;#160; One of the ways I track what’s happened on a SQL Server instance is through wait stats.&amp;#160; Now if you aren’t tracking wait stats and they aren’t one of the first few things that you check when monitoring performance then you need to stop reading this post and &lt;a href="http://sqlcat.com/whitepapers/archive/2007/11/19/sql-server-2005-waits-and-queues.aspx"&gt;read this instead&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Wait Stat Snapshots&lt;/h4&gt;  &lt;p&gt;To facilitate wait stat monitoring, I typically take a snapshot of the current wait stats (&lt;a href="http://msdn.microsoft.com/en-us/library/ms179984.aspx"&gt;sys.dm_os_wait_stats&lt;/a&gt;) on a server every 15 minutes.&amp;#160; This is enough time that I can roll get a good idea of what’s happened from a resource perspective in a short amount of time and I can also easily roll the value up to hour, two-hour, or full day totals.&amp;#160; It gives me options – we all like options.&lt;/p&gt;  &lt;p&gt;As I’ve done in a number of posts in the past this new script will be setup to add to the &lt;a href="http://stratesql.com/categories/DBADiagnostics.aspx"&gt;DBADiagnostics database&lt;/a&gt; that I’ve blogged about before.&lt;/p&gt;  &lt;h4&gt;Building the Snapshot&lt;/h4&gt;  &lt;p&gt;There are two table included in the process for creating the snapshots of wait stat activity.&amp;#160; These are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Monitor.WaitStatSnapshot&lt;/li&gt;    &lt;li&gt;Monitor.WaitStatHistory&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Here is the schema to create them:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [Monitor].[WaitStatSnapshot](&lt;br /&gt;    [CreateDate] [datetime] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [WaitType] [nvarchar](60) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [WaitingTasksCount] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [WaitTimeMs] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [MaxWaitTimeMs] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [SignalWaitTimeMs] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; [PK_Monitor_WaitStatSnapshot_CreateDateWaitType] &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CLUSTERED&lt;/span&gt; ([CreateDate] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;, [WaitType] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;)&lt;br /&gt;) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;]&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [Monitor].[WaitStatHistory](&lt;br /&gt;    [CreateDate] [datetime] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [WaitType] [nvarchar](60) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [WaitingTasksCount] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [WaitTimeMs] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [MaxWaitTimeMs] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    [SignalWaitTimeMs] [bigint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; [PK_Monitor_WaitStatHistory_CreateDateWaitType] &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CLUSTERED&lt;/span&gt; ([CreateDate] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;, [WaitType] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;)&lt;br /&gt;) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;]&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;The general process is to insert the current values from the wait stat DMV into Monitor.WaitStatSnapshot.&amp;#160; After which the delta between the last two snapshots in Monitor.WaitStatSnapshot is inserted into Monitor.WaitStatHistory.&lt;/p&gt;

&lt;p&gt;If the values in the last snapshot are smaller that those in the second to last snapshot, then the insert assumes that the wait stat DMV has been reset.&amp;#160; Resetting can occur either though a SQL Server service restart or a DBCC command.&amp;#160; &lt;/p&gt;

&lt;p&gt;Either way the procedure below will accumulate a snapshot history from the wait stat DMV.&amp;#160; Of courses there are a couple parameters that provide some automated cleanup.&amp;#160; Data in Monitor.WaitStatSnapshot is cleaned up after 1 day and the data in Monitor.WaitStatHistory is cleaned up after 90 days.&amp;#160; This helps prevent the data in the DBADiagnostic database from taking over when it’s neglected because everything is running perfectly.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;/*================================================================================&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;Procedure:    Monitor.TrackWaitStats&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;Author:        Jason Strate&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;Date:        October 26, 2009&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;Synopsis:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;    This procedure takes snapshots of wait stats and compares them with previous &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;    snapshots to determine a delta of changes over time.  Raw snapshot information&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;    is deleted on a short time span, while the delta information in the history&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;    table is deleted over a longer time span.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;================================================================================&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;Revision History:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;Date:        By            Description&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;----------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;================================================================================*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Monitor].[TrackWaitStats]&lt;br /&gt;    (&lt;br /&gt;    @SnapshotDays tinyint = 1&lt;br /&gt;    ,@HistoryDays &lt;span style="color: #0000ff"&gt;smallint&lt;/span&gt; = 90&lt;br /&gt;    )&lt;br /&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; Monitor.WaitStatSnapshot&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; GETDATE()&lt;br /&gt;    , &lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; wait_type &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'MISCELLANEOUS'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'MISCELLANEOUS'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ELSE&lt;/span&gt; wait_type &lt;span style="color: #0000ff"&gt;END&lt;/span&gt;&lt;br /&gt;    , &lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(waiting_tasks_count)&lt;br /&gt;    , &lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(wait_time_ms)&lt;br /&gt;    , &lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(max_wait_time_ms)&lt;br /&gt;    , &lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(signal_wait_time_ms)&lt;br /&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.dm_os_wait_stats&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GROUP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; wait_type &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'MISCELLANEOUS'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #006080"&gt;'MISCELLANEOUS'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ELSE&lt;/span&gt; wait_type &lt;span style="color: #0000ff"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; WaitStatCTE&lt;br /&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; CreateDate&lt;br /&gt;        , DENSE_RANK() &lt;span style="color: #0000ff"&gt;OVER&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; CreateDate &lt;span style="color: #0000ff"&gt;DESC&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; HistoryID&lt;br /&gt;        , WaitType&lt;br /&gt;        , WaitingTasksCount&lt;br /&gt;        , WaitTimeMs&lt;br /&gt;        , MaxWaitTimeMs&lt;br /&gt;        , SignalWaitTimeMs&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Monitor.WaitStatSnapshot&lt;br /&gt;    )&lt;br /&gt;INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; Monitor.WaitStatHistory&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; w1.CreateDate&lt;br /&gt;    , w1.WaitType &lt;br /&gt;    , w1.WaitingTasksCount - &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(w2.WaitingTasksCount,0)&lt;br /&gt;    , w1.WaitTimeMs - &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(w2.WaitTimeMs,0)&lt;br /&gt;    , w1.MaxWaitTimeMs - &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(w2.MaxWaitTimeMs,0)&lt;br /&gt;    , w1.SignalWaitTimeMs - &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(w2.SignalWaitTimeMs,0)&lt;br /&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; WaitStatCTE w1&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; WaitStatCTE w2 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; w1.WaitType = w2.WaitType &lt;br /&gt;        &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; w1.WaitingTasksCount &amp;gt;= &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(w2.WaitingTasksCount,0)&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; w2.HistoryID = 2 &lt;br /&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; w1.HistoryID = 1 &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;DELETE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Monitor.WaitStatSnapshot&lt;br /&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; CreateDate &amp;lt; DATEADD(d, -@SnapshotDays, GETDATE())&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;DELETE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Monitor.WaitStatHistory&lt;br /&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; CreateDate &amp;lt; DATEADD(d, -@HistoryDays, GETDATE())&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;There you have it.&amp;#160; While I didn’t go into how you can and will use this information, the basis for collecting this data for reporting has been laid out.&lt;/p&gt;

&lt;p&gt;Later this week I’ll post a follow-up to show how to report on this information and include a couple Reporting Services reports for digging into the data.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Hi, Eric Stratton, Rush chairman&amp;hellip;</title>
		<link rel="alternate" href="http://stratesql.com/2009/11/09/hi-eric-stratton-rush-chairmanhellip.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-11-09:11a2057c-c32b-4d36-a7d5-e9c38e0212d2</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SQLServer" />
		<category term="PASS Summit" />
		<category term="Conference" />
		<updated>2009-11-09T13:46:00Z</updated>
		<published>2009-11-09T13:46:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/otter_2.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="otter" border="0" alt="otter" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/otter_thumb.gif" width="240" height="179" /&gt;&lt;/a&gt;A few times this past week I heard the quote, “Hi, Eric Stratton, Rush chairman, damn glad to meet you”.&amp;#160; That line kind of summarizes what the PASS Summit was like for me this year.&amp;#160; It’s been like coming to a week long rush event for the best fraternity in the world.&amp;#160; This fraternity isn’t the Delta Tau Chi’s though, it’s the &lt;a href="http://sqlpass.org/"&gt;PASS organization&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The PASS Summit was a chance to look at upcoming features in SQL Server, share learning in nearly 170 presentations, and networking with peers from across the street and the other side of the world.&amp;#160; It wasn’t always serious and one night at the karaoke bar a fellow DBA &lt;a href="http://en.wikipedia.org/wiki/Rick_roll"&gt;Rick Rolled&lt;/a&gt; us. &lt;/p&gt;  &lt;h4&gt;A Great Change&lt;/h4&gt;  &lt;p&gt;This year was drastically different though (&lt;strike&gt;for me at least&lt;/strike&gt;) – and I believe it has everything to do with social networking.&amp;#160; It started a bit last year, but now with the flood of SQL Server professionals on twitter it seems to have matured quite a bit.&amp;#160; From the first day I was at the conference, I was recognizing people that I’ve shared conversations with on Twitter.&amp;#160; And I didn’t have deal with the nervousness of meeting them for the first time, since Twitter and Social Networking had taken care of that.&lt;/p&gt;  &lt;p&gt;Last year at the PASS Summit, I think I met about a dozen new people.&amp;#160; Most of the people I talked to were just people I had met through out that year.&amp;#160; They were a good group of people, but I mostly just continued to develop those relationships.&lt;/p&gt;  &lt;p&gt;This year though, I think I met about a hundred people that I hadn’t met before.&amp;#160; True, I had talked with a number of them prior to PASS through Twitter.&amp;#160; But I hadn’t actually met them.&amp;#160; And let’s be honest, I’m just this guy from Minneapolis.&amp;#160; I’m not someone who’s written books or worked on the DBCC commands.&lt;/p&gt;  &lt;p&gt;What I am getting at here is that anyone can be a part of the community.&amp;#160; It’s a matter of joining in and becoming a part of the conversation.&amp;#160; And with Twitter anyone can join the conversation at any time.&amp;#160; Or you can just listen, but you’ll eventually join in… it’s too tempting.&lt;/p&gt;  &lt;h4&gt;Doing It Wrong&lt;/h4&gt;  &lt;p&gt;I’m going to say it.&amp;#160; I’ve said it to others and I’m going to say it here.&amp;#160; &lt;em&gt;If you are a SQL Server professional and you are not on Twitter yet, you are doing it wrong.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;If you are at a company and you are the lone DBA. &lt;strong&gt; *POOF*&lt;/strong&gt;&amp;#160; No more.&amp;#160; Hundreds of others in your same boat, dealing with the same issues are there for you.&amp;#160; If you’re at a large organization dealing with hundreds of servers and run across a new issue that no one at your company has seen.&amp;#160; &lt;strong&gt;*POOF*&lt;/strong&gt; I bet someone out on Twitter has and they might be able to help you through the answer.&lt;/p&gt;  &lt;p&gt;I can’t stress the benefits of social networking enough.&amp;#160; It really gives you a door into the office of hundreds of other SQL Server professional who can help you solve problems and give you a sense of community with what you are doing.&amp;#160; And when it comes to the PASS Summit, it’s a way to find out where people are going, what they are doing, and how to get around town to hot spots that others are checking out.&lt;/p&gt;  &lt;p&gt;I hope this little unwinding from PASS helps you decide that you need to get on Twitter if you are not already.&amp;#160; And also helps you reconsider the PASS Summit if you haven’t gone to it yet.&amp;#160; I have more thoughts on PASS that I’ll be posting later.&lt;/p&gt;  &lt;p&gt;You can &lt;a href="http://www.sqlpass.org/summit/na2010"&gt;register already for next year&lt;/a&gt;…&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Tap,  Tap, Tap &amp;ndash; SSWUG Conference Starts Today</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/21/tap--tap-tap-ndash-sswug-conference-starts-today.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-21:d194adbd-7e41-498d-917a-f65f30432bb6</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQL 2008" />
		<category term="SQL RS" />
		<category term="SSIS" />
		<category term="SQL 2005" />
		<category term="Conference" />
		<updated>2009-10-21T11:00:00Z</updated>
		<published>2009-10-21T11:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssccdl_couch-laptop1_250x20_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="ssccdl_couch-laptop1_250x20" border="0" alt="ssccdl_couch-laptop1_250x20" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssccdl_couch-laptop1_250x20_thumb.jpg" width="244" height="196" /&gt;&lt;/a&gt;The &lt;a href="http://www.vconferenceonline.com/shows/fall09/uvc/"&gt;SSWUG Ultimate Virtual Conference&lt;/a&gt; starts this morning.&amp;#160; Are you planning to take advantage of this opportunity?&amp;#160; The &lt;a href="http://www.brentozar.com/"&gt;Rock&lt;/a&gt; &lt;a href="http://www.thomaslarock.com/"&gt;Star&lt;/a&gt; &lt;a href="http://chrisshaw.wordpress.com/"&gt;speakers&lt;/a&gt; are waiting in the channels, anticipating you every move.&amp;#160; But, have you registered?&lt;/p&gt;  &lt;p&gt;It’s not too late.&amp;#160; If you can’t get to the sessions today, there is always tonight to go through and view them.&amp;#160; Just check out what the conference includes.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;More than 75 technical sessions &lt;/li&gt;    &lt;li&gt;New! Live sessions track - all live sessions, with speaker Q&amp;amp;A/interviews at the end of the day &lt;/li&gt;    &lt;li&gt;On-Demand access to sessions for 45 days - miss a session? No problem. &lt;/li&gt;    &lt;li&gt;Chat, Twitter Integration, SKYPE integration for Q&amp;amp;A &lt;/li&gt;    &lt;li&gt;Experience-based learning - find out what you need to know from people that are using the technology every day &lt;/li&gt;    &lt;li&gt;These are NOT sales presentations. &lt;/li&gt;    &lt;li&gt;6-Month SSWUG.ORG Membership (or membership extension), included! &lt;/li&gt;    &lt;li&gt;ALL-ACCESS Pass: SQL Server and Business Intelligence with related SharePoint and .NET technologies - all included, one low price &lt;/li&gt;    &lt;li&gt;Great vendor hall - learn about the best tools, technologies, publications and partners out there for your shop &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Hope in and join the conference!&amp;#160; I’ll be there after my morning meeting.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Are You Registered?</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/14/are-you-registered.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-14:dd034b4d-bda1-4865-9a08-5d31f6c020b2</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL RS" />
		<category term="SSIS" />
		<category term="SQL 2005" />
		<category term="Conference" />
		<category term="SQL 2008" />
		<updated>2009-10-14T14:00:00Z</updated>
		<published>2009-10-14T14:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssccdl_couch-laptop1_250x20_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ssccdl_couch-laptop1_250x20" border="0" alt="ssccdl_couch-laptop1_250x20" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssccdl_couch-laptop1_250x20_thumb.jpg" width="244" height="196" /&gt;&lt;/a&gt; It starts next week,the &lt;a href="http://www.vconferenceonline.com/shows/fall09/uvc/"&gt;SSWUG Ultimate Virtual Conference on October 21-24&lt;/a&gt;.&amp;#160; This is an excellent opportunity to get the benefits of heading to a conference full of &lt;a href="http://www.brentozar.com/"&gt;Rock&lt;/a&gt; &lt;a href="http://www.thomaslarock.com/"&gt;Star&lt;/a&gt; &lt;a href="http://chrisshaw.wordpress.com/"&gt;speakers&lt;/a&gt; while being able to view the content from the comforts of home or your desk.&amp;#160; &lt;/p&gt;  &lt;h4&gt;Have you registered?&lt;/h4&gt;  &lt;p&gt;If you haven’t registered yet, I really recommend that you do.&amp;#160; Heck, you can even use this discount (SPJSUVC09) to save a little on the registration.&amp;#160; But I’ve told you what to do, have I told you why.&amp;#160; Well, let’s take a look at some bullet points that describe the conference:&amp;#160; &lt;strike&gt;‘Cuz we all like bullet points.&lt;/strike&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;More than 75 technical sessions &lt;/li&gt;    &lt;li&gt;New! Live sessions track - all live sessions, with speaker Q&amp;amp;A/interviews at the end of the day &lt;/li&gt;    &lt;li&gt;On-Demand access to sessions for 45 days - miss a session? No problem. &lt;/li&gt;    &lt;li&gt;Chat, Twitter Integration, SKYPE integration for Q&amp;amp;A &lt;/li&gt;    &lt;li&gt;Experience-based learning - find out what you need to know from people that are using the technology every day &lt;/li&gt;    &lt;li&gt;These are NOT sales presentations. &lt;/li&gt;    &lt;li&gt;6-Month SSWUG.ORG Membership (or membership extension), included! &lt;/li&gt;    &lt;li&gt;ALL-ACCESS Pass: SQL Server and Business Intelligence with related SharePoint and .NET technologies - all included, one low price &lt;/li&gt;    &lt;li&gt;Great vendor hall - learn about the best tools, technologies, publications and partners out there for your shop &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Are you jazzed?&amp;#160; Wait, I didn’t make you laugh.&amp;#160; Good sales pitches always include some laughter.&amp;#160; One more bullet point:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The conference that started the &lt;a href="http://www.brentozar.com/archive/2009/04/new-sql-server-editions-sqleditions/"&gt;best SQL Server humor threads&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Yeah, that’s right.&amp;#160; And there just might be more humor at the one coming up.&amp;#160; So let’s get signed up.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Missing Blogger</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/12/missing-blogger.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-12:625d1eb8-1891-4abe-9b66-fd5c5885b6fe</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<updated>2009-10-12T16:05:00Z</updated>
		<published>2009-10-12T16:05:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/missing_puzzle.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="missing_puzzle" border="0" alt="missing_puzzle" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/missing_puzzle_thumb.jpg" width="127" height="126" /&gt;&lt;/a&gt; I’ve been skipping on posting technical blogs for a couple months.&amp;#160; I’m planning to put that issue to rest with some aggressive blogging over the next couple months to make up for lost time.&amp;#160; After reading &lt;a href="http://sqlfool.com/2009/10/why-im-blogging-less/"&gt;SQL Fool’s post&lt;/a&gt; on her reasons for change, I figured I’d do the same.&amp;#160; Not because anyone has noticed but because I want to lay out a plan that I’ll stick to.&lt;/p&gt;  &lt;h4&gt;Making Excuses&lt;/h4&gt;  &lt;p&gt;I don’t have any reasons as good as a baby in my belly for why I haven’t been blogging so much.&amp;#160; But I’ll share my reasons nonetheless&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;PASSMN SQL Summit 2009: &lt;/strong&gt;Our user group put together an all-day Friday SQL event.&amp;#160; It was great and a lot of fun.&amp;#160; We had nearly 100 people there for the entire day and from the surveys that I saw it was a wild success.&amp;#160; Now to see if I can inspire people for a SQL Saturday in the spring. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Presenting: &lt;/strong&gt;I’m sure others have been doing this as much as I have but I’m still fairly green at this and it takes time to put them all together.&amp;#160; On the up side, after this month I have one left for the entire year. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;The House: &lt;/strong&gt;It’s being sold and now I have to finish all of my house projects.&amp;#160; Saying I am good at starting them and not finishing them is the understatement of the year. &lt;/li&gt; &lt;/ol&gt;  &lt;h4&gt;The “Plan”&lt;/h4&gt;  &lt;p&gt;There are a number of things I plan to touch on relatively quickly.&amp;#160; Some of these topics are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;More &lt;/strong&gt;&lt;a href="http://stratesql.com/categories/DBADiagnostics.aspx"&gt;&lt;strong&gt;DBA Diagnostics&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;: &lt;/strong&gt;Let’s be honest, database administration is always a good topic and this conversation never even hit the good stuff.&amp;#160; Such as backups or index and statistic maintenance.&amp;#160; I even have reports that go with some of this stuff. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;My journey into MDM: &lt;/strong&gt;I’ve talked to a number of clients in the past few months about MDM.&amp;#160; Amazingly, as knew as this topic seems to be, it is just new framework around an old problem.&amp;#160; I am hoping to cover MDM from the basics to the implementation and examples of past projects that could be considered “partial” MDM solutions.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Web Testing: &lt;/strong&gt;Recently, I worked on testing a SharePoint site that was using Reporting Services in Integrated Mode.&amp;#160; I found out quite a bit when it came to testing SSRS reports and controlling report functionality through a web test.&amp;#160; I plan to share as much of that as I can.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Extended Events: &lt;/strong&gt;I really love these and hope to help others love them as well.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Implementing Best Practices: &lt;/strong&gt;I’ve been working with Policy Based management for a work project and plan to develop some policies to implement and monitor best practices and share those on here.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Presentations: &lt;/strong&gt;I’ve delivered about a dozen different presentations over the past year.&amp;#160; Most of the time when I want to learn something I either find a project or a presentation that forces me to learn it.&amp;#160; It’s my method.&amp;#160; Well, I’ve got this library of useful stuff now and plan to share that here as well.&lt;/li&gt; &lt;/ul&gt; Hopefully I can get this interesting again… and very soon.  </content>
	</entry>
	<entry>
		<title>User Group Study Groups&amp;hellip; Anyone?</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/07/user-group-study-groupshellip-anyone.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-07:a0ff2d48-9041-4efa-9d66-f4e5299c04d0</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="Certification" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="Career" />
		<category term="SQL 2008" />
		<updated>2009-10-07T16:10:00Z</updated>
		<published>2009-10-07T16:10:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/brownies2_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="brownies2" border="0" alt="brownies2" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/brownies2_thumb.jpg" width="199" height="146" /&gt;&lt;/a&gt;Somehow I managed to get through college without ever joining a study group.&amp;#160; None… ever.&amp;#160; I don’t even know how one would put one together properly.&amp;#160; Well, I do know from watching movies that someone is always responsible for bringing brownies or some other treat to share.&amp;#160; But I don’t think that’s the main goal.&lt;/p&gt;  &lt;p&gt;My main understanding is that you get a bunch of people together that are motivated toward a common goal and because of the diversity of the group you have immediate resources on hand to answer or bounce questions off of.&lt;/p&gt;  &lt;p&gt;So this leaves me with some questions:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Does anyone have any experience with putting together study groups for working towards certifications?&lt;/li&gt;    &lt;li&gt;If so, what are some must-dos and gotchas that are important for success?&lt;/li&gt;    &lt;li&gt;Would anyone in the Twin Cities metro area be interested in joining a study group?&lt;/li&gt; &lt;/ol&gt;</content>
	</entry>
	<entry>
		<title>SQL Server Certification Discounts</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/07/sql-server-certification-discounts.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-07:8889239b-e996-4f4d-a31a-a888b192b8b4</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Certification" />
		<updated>2009-10-07T12:18:00Z</updated>
		<published>2009-10-07T12:18:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/discount-coupons_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="discount-coupons" border="0" alt="discount-coupons" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/discount-coupons_thumb.jpg" width="149" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I like discounts.&amp;#160; Paying full price when I don’t have to sucks.&amp;#160; It’s a waste of resources, and as a person who’s had to tune databases in the past I’ve grown quite fond of resource management.&amp;#160; And the best resource ever to manage is dollars.&amp;#160; Because you can buy &lt;a href="http://www.sea-doo.com/en-US/watercraft/musclecraft/rxt-is/"&gt;stuff&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;What About 2nd Chance?&lt;/h4&gt;  &lt;p&gt;I was a big fan of the &lt;a href="http://stratesql.com/2009/05/18/your-2nd-chance-end-june-30.aspx"&gt;2nd Chance Exam&lt;/a&gt; offer that Microsoft used to have.&amp;#160; This offer allowed you to take the exam with an insurance policy that if you failed the first time, it was free to re-take once.&amp;#160; For every exam I took over the past two years, I used that offer.&amp;#160; That is, until it was allowed to expire.&amp;#160; &lt;strike&gt;Sad face.&lt;/strike&gt;&lt;/p&gt;  &lt;h4&gt;The New Offer&lt;/h4&gt;  &lt;p&gt;Microsoft is offering a new discount on exams from &lt;a href="http://www.microsoft.com/learning/en/us/offers/career.aspx"&gt;15% to 25% off the exam price&lt;/a&gt;.&amp;#160; These exam discounts are available for both SQL Server 2005 and SQL Server 2008.&amp;#160; The offer is available until the December 31, so it is a limited time offer.&amp;#160; Of course, this doesn’t include any guarantee that you’ll pass the exam but you can’t have a chance to pass them if you don’t give it a try.&lt;/p&gt;  &lt;h4&gt;Get Your Discount&lt;/h4&gt;  &lt;p&gt;Now that we have a new discount, we should take advantage of it.&amp;#160; Just think, if you take a few exams and save enough bucks and I bet you could justify going out to eat at &lt;a href="http://www.fogodechao.com/"&gt;Fogo&lt;/a&gt;.&amp;#160; Bring on the meat!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Meats_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Meats" border="0" alt="Meats" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Meats_thumb.jpg" width="652" height="141" /&gt;&lt;/a&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Checking EXISTS &amp;ndash; What&amp;rsquo;s Your Practice?</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/06/checking-exists-ndash-whatrsquos-your-practice.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-06:f119a68f-d0b1-47af-94ae-8c519c56034a</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2000" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<updated>2009-10-06T12:00:00Z</updated>
		<published>2009-10-06T12:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Old%20microphone_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Old microphone" border="0" alt="Old microphone" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Old%20microphone_thumb.jpg" width="126" height="179" /&gt;&lt;/a&gt;Michael Swart (&lt;a href="http://dbwhisperer.blogspot.com/"&gt;Database Whisperer&lt;/a&gt;) posted a &lt;a href="http://dbwhisperer.blogspot.com/2009/10/spotlight-on-brad-schulz-yall.html"&gt;great write up and interview&lt;/a&gt; with &lt;a href="http://bradsruminations.blogspot.com/"&gt;Brad Schulz&lt;/a&gt; that is worth checking out.&amp;#160; Michael’s post links to a post from Brad on the &lt;a href="http://bradsruminations.blogspot.com/2009/09/age-old-select-vs-select-1-debate.html"&gt;use of EXIST and what is required for the SELECT portion of the statement&lt;/a&gt;.&amp;#160; &lt;strike&gt;Hope you are still with me.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;Definitely worth the read and +1&amp;#160; for my blog subscriber list.&lt;/p&gt;  &lt;p&gt;As he demonstrates, it doesn’t matter whether you use SELECT *, SELECT 1 or SELECT 1/0.&amp;#160; If you want to know what this means, please read his post.&amp;#160; &lt;/p&gt;  &lt;p&gt;From SQL Server’s perspective, it doesn’t consider any of this information in preparing the results.&amp;#160; The only thing that matters and this is from a practices perspective is to select a style for writing EXISTS statements and sticking to it.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>To Be Or Not To Be In the Memory Buffer</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/05/to-be-or-not-to-be-in-the-memory-buffer.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-05:080ca2cb-da9f-442c-84d2-8d802ed00426</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<updated>2009-10-05T13:56:00Z</updated>
		<published>2009-10-05T13:56:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/William_Shakespeare_portrait_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="William_Shakespeare_portrait" border="0" alt="William_Shakespeare_portrait" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/William_Shakespeare_portrait_thumb.jpg" width="125" height="145" /&gt;&lt;/a&gt;Sometimes when I get pulled in to look at a database, I’ll sit down with the developers or database administrators working on the database and get some background on the database.&amp;#160; This usually includes pointing on the important tables, an explanation of why some design decisions were made, and some pre-conceived notions about where to begin focusing.&lt;/p&gt;  &lt;p&gt;I’m going to pass on going through my triage process today, but instead focus on the notion of important tables.&amp;#160; This is an area that I often get to provide some immediate feedback to the client.&lt;/p&gt;  &lt;h4&gt;The Importance in Being Important&lt;/h4&gt;  &lt;p&gt;How does one define an important data?&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;The most data?&amp;#160; &lt;/strong&gt;This seems a no-brainer but don’t archive tables tend to usually be pretty large and by being archive, maybe no longer important data. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;The most recently updated data?&amp;#160; &lt;/strong&gt;Probably not, this could have been the StateProvince tables because Jim in marketing decided that Puerto Rico should be a country now.&amp;#160; &lt;strike&gt;Yeah, I worked at a place where some days it was a country and others a territory.&lt;/strike&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;The most sensitive data?&amp;#160; &lt;/strong&gt;While a customer may feel the security of their data is the most important aspect of the data in your database.&amp;#160; If I’m out looking into performance issues, it might not be a consideration in this scenario. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;The most active data?&lt;/strong&gt;&amp;#160; This is usually where I tend to focus.&amp;#160; Data that is being used is probably the most important data in the system.&amp;#160; Especially if a lot of the data is being used. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Finding the Most Active Data&lt;/h4&gt;  &lt;p&gt;To find the active data, a good place to start looking would be in the memory buffer.&amp;#160; Since data that is most actively being used will hang out there it is a good indicator of what your active data is.&amp;#160; By looking at the data in memory, you can start to make decisions on which tables and indexes to pay a little more attention to.&amp;#160; The trouble with this approach though will be that data used now may not be used later. &lt;/p&gt;  &lt;p&gt;But that might be exactly the problem.&amp;#160; If you know that an un-indexed archive table is never used and the entire table is in memory, that may be the source of some problems.&amp;#160; Something had to move out of memory for something to move into it.&lt;/p&gt;  &lt;p&gt;Below is the T-SQL Script that I used to determine what is in the buffer.&amp;#160; It is scoped to the database level so you would need to run this multiple times across a few databases to see what is going on for the entire server.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; AllocationUnits&lt;br /&gt;&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;br /&gt;        p.object_id&lt;br /&gt;        ,p.index_id&lt;br /&gt;        ,p.partition_number &lt;br /&gt;        ,au.allocation_unit_id&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.allocation_units &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; au&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.partitions &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; p &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (au.type = 1 &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; au.type = 3)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;UNION&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ALL&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; p.object_id&lt;br /&gt;        ,p.index_id&lt;br /&gt;        ,p.partition_number &lt;br /&gt;        ,au.allocation_unit_id&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.allocation_units &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; au&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.partitions &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; p &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.container_id = p.partition_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; au.type = 2&lt;br /&gt;)&lt;br /&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; t.name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; table_name&lt;br /&gt;    ,i.name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; index_name&lt;br /&gt;    ,i.[type_desc]&lt;br /&gt;    ,au.partition_number&lt;br /&gt;    ,&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; buffered_page_count&lt;br /&gt;    ,&lt;span style="color: #0000ff"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2), &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; bigint)*&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(8 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;)/1024) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; buffer_mb&lt;br /&gt;&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.dm_os_buffer_descriptors &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; bd &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; AllocationUnits au &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; bd.allocation_unit_id = au.allocation_unit_id&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.all_objects t &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.object_id = t.object_id&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.indexes i &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.object_id = i.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; au.index_id = i.index_id&lt;br /&gt;&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; bd.database_id = db_id()&lt;br /&gt;&lt;span style="color: #0000ff"&gt;GROUP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; t.name, i.name,i.[type_desc], au.partition_number&lt;br /&gt;&lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;DESC&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;HINT: &lt;/strong&gt;Try running this on MSDB some time right after database backups.&amp;#160; I’ve run into a few cases where backup tables haven’t been cleaned up in ages and the amount of data in those tables bumps a lot of user data out of the buffer while performing backups.&amp;#160; Not the most ideal situation.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Free SQL Server Security Book</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/04/free-sql-server-security-book.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-04:c703d727-7abf-4f06-8e3f-3b685310204b</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Free" />
		<category term="Security" />
		<updated>2009-10-05T04:00:00Z</updated>
		<published>2009-10-05T04:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/defendius-door-lock_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="defendius-door-lock" border="0" alt="defendius-door-lock" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/defendius-door-lock_thumb.jpg" width="144" height="140" /&gt;&lt;/a&gt; I saw &lt;a href="http://bradmcgehee.com/2009/09/free-book-protecting-sql-server-data/"&gt;this post&lt;/a&gt; a few weeks back and got around to downloading it myself tonight.&amp;#160; If you don’t know what &lt;strong&gt;&lt;em&gt;it &lt;/em&gt;&lt;/strong&gt;is.&amp;#160; It’s a free SQL Server security book. &lt;/p&gt;  &lt;h4&gt;Best of both Worlds&lt;/h4&gt;  &lt;p&gt;There are two things I like about this e-book.&amp;#160; The first, it is free.&amp;#160; And the second, it’s a book on security which there will never be enough of.&amp;#160; Sadly, security is one of those areas that seem to be overlooked until it is often too late.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Don&amp;rsquo;t miss out! Oct 21 &amp;ndash; IT Care - Painting by Numbers, Update Your SQL Skills with New Paintbrushes</title>
		<link rel="alternate" href="http://stratesql.com/2009/10/02/donrsquot-miss-out-oct-21-ndash-it-care--painting-by-numbers-update-your-sql-skills-with-new-paintbrushes.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-10-02:db8f2c75-e090-45bd-b869-bdb9a79796f5</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Tools and Tips" />
		<category term="Conference" />
		<category term="Performance Tuning" />
		<updated>2009-10-02T16:29:00Z</updated>
		<published>2009-10-02T16:29:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/star_wars_paint_by_numbers_4.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="star_wars_paint_by_numbers" border="0" alt="star_wars_paint_by_numbers" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/star_wars_paint_by_numbers_thumb_1.jpg" width="244" height="164" /&gt;&lt;/a&gt; Coming up this month is a &lt;a href="http://en.wikipedia.org/wiki/Freegan" target="_blank"&gt;free&lt;/a&gt; event to discover more ways to write T-SQL here is an event for you.&amp;#160; The session will be hosted by yours truly and features T-SQL tricks and tips that I’ve picked up and want to spread the word on.&lt;/p&gt;  &lt;p&gt;Here is the registration &lt;a href="http://www.nhmn.com/Courses/CrsDetail.aspx?C=NHITCare102109" target="_blank"&gt;link&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;And the details:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Course Overview&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;ITCare, delivered and hosted quarterly by our Partners is designed to keep you up to date on the cutting-edge technologies. ITCare is a FREE half-day technical seminar series created by IT Professionals for IT Professionals! We'll address the needs and issues today and show you how to make a real difference in the way that you work.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;While not everyone may not be a great painter, there is an art form to writing great SQL statements. In this session we'll go over tips and tricks in writing SQL. We'll also review some popular bad practices and provide demonstrations to better change those velvet Elvis's to Rembrandts. As every paint brush can't produce a masterpiece, the same goes for SQL statements. Writing good SQL code requires the right brush. After this session, you'll have a few more paintbrushes and probably throw out a few that are no longer useful.&lt;/p&gt; 1. Review and discussion of common coding methods can impact performance.     &lt;br /&gt;2. Discussion of uncommon coding methods that can be used to improve performance.     &lt;br /&gt;3. Review and application of existing T-SQL functions.     &lt;p&gt;&lt;strong&gt;Audience&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Junior to mid-level SQL Server developers&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Understanding of basic T-SQL coding skills.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Course Price&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;$0.00&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Topics&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Speaker: Jason Strate of Digineer, Inc. Jason Strate has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft's published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition and actively blogs about SQL Server and related technologies. Also this past year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008 and presented at the SSWUG SQL Server Launch Event and the last two SSWUG Virtual SQL Server Conferences.&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>User Group Networking Bingo</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/29/user-group-networking-bingo.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-29:1d62938b-62b9-4e69-bbb0-1abbf5d955c6</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="MNSSUG" />
		<category term="Conference" />
		<updated>2009-09-29T20:00:00Z</updated>
		<published>2009-09-29T20:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/47927_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="47927" border="0" alt="47927" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/47927_thumb.jpg" width="142" height="169" /&gt;&lt;/a&gt; I’ve been to a number of conferences and have always found it difficult to walk up to people that I don’t know and introduce myself.&amp;#160; It’s just not something that comes natural to me.&amp;#160; And I’ve found that this typically isn’t a strength of other people in the IT community.&lt;/p&gt;  &lt;p&gt;When we were planning our recent event, a full day event similar to SQL Saturday but on a Friday, I wanted to add something that got people to meet people that they didn’t know and start some networking.&lt;/p&gt;  &lt;p&gt;Lara Rubbelke (&lt;a href="http://twitter.com/SQLGal"&gt;@SQLGal&lt;/a&gt;) suggested that we try doing a bingo card.&amp;#160; It had been used for a recent event she had attended and it seemed like a good idea. And fit the concept I was thinking of – getting lots of people to talk to strangers and get to know people outside their typical bubble.&amp;#160; &lt;/p&gt;  &lt;h4&gt;The Game&lt;/h4&gt;  &lt;p&gt;To set this up, we put together a word document that looked like a Bingo card with 12 squares.&amp;#160; The purpose was for each attendee to find someone that matched a square and get their initials.&amp;#160; We used the following items on our card.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Attended DBA Track Session&lt;/li&gt;    &lt;li&gt;Attended Developer Track Session&lt;/li&gt;    &lt;li&gt;Attended BI Track Session&lt;/li&gt;    &lt;li&gt;SQL Server 2008 in production&lt;/li&gt;    &lt;li&gt;SQL Server version prior to 2005 in production&lt;/li&gt;    &lt;li&gt;Presented PASSMN SQL Summit Session&lt;/li&gt;    &lt;li&gt;1+ TB database in production&lt;/li&gt;    &lt;li&gt;Passed SQL Server 2005/2008 Certification&lt;/li&gt;    &lt;li&gt;Service Broker in Production&lt;/li&gt;    &lt;li&gt;Blogs on SQL Server&lt;/li&gt;    &lt;li&gt;PASSMN LinkedIn Member&lt;/li&gt;    &lt;li&gt;Microsoft Employee&lt;/li&gt;    &lt;li&gt;Twitters&lt;/li&gt;    &lt;li&gt;SQL Server MVP&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;    &lt;li&gt;Used SQL Server 4.1&amp;#160; &lt;strike&gt;Yes, this guys was at our event.&lt;/strike&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;The Payoff&lt;/h4&gt;  &lt;p&gt;Instead of just using survey’s for giveaways at the end of the event, we opted to use the Networking Bingo card to drive people to try to complete the card.&amp;#160; This turned out to be huge.&amp;#160; People were chatting and networking and some people managed to care all of the squares on the bingo card before the first break.&lt;/p&gt;  &lt;p&gt;The real payoff was the amount of networking that we had between the sessions.&amp;#160; Instead of sitting at the tables waiting for the next session, most people were up and about meeting and talking to people.&amp;#160; Some people came up and mentioned how much they enjoyed a reason to network for a change.&lt;/p&gt;  &lt;p&gt;It was awesome!&lt;/p&gt;  &lt;p&gt;I’ve attached our bingo card, so feel free to use it for your own event.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:F60BB8FA-6F02-4999-8F5E-9DD4E92C4DA7:6f782671-4e49-45e7-aa87-33541133e920" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/PASSMN.SQL.Summit.Networking.Bingo.docx" target="_blank"&gt;PASSMN SQL Summit Networking Bingo.docx&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>Check out the Ultimate Virtual Conference from SSWUG</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/29/check-out-the-ultimate-virtual-conference-from-sswug.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-29:3d590249-dbcb-410f-8239-301d96e8a799</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SSIS" />
		<category term="SQL 2005" />
		<category term="Conference" />
		<updated>2009-09-29T19:00:00Z</updated>
		<published>2009-09-29T19:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssccdl_couch-laptop1_250x20_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ssccdl_couch-laptop1_250x20" border="0" alt="ssccdl_couch-laptop1_250x20" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssccdl_couch-laptop1_250x20_thumb.jpg" width="244" height="196" /&gt;&lt;/a&gt; In less than a month &lt;a href="http://www.vconferenceonline.com/shows/fall09/uvc/"&gt;SSWUG will be hosting the Ultimate Virtual Conference on October 21-24&lt;/a&gt;.&amp;#160; This is an excellent opportunity to get the benefits of heading to a conference full of &lt;a href="http://www.brentozar.com/"&gt;Rock&lt;/a&gt; &lt;a href="http://www.thomaslarock.com/"&gt;Star&lt;/a&gt; &lt;a href="http://chrisshaw.wordpress.com/"&gt;speakers&lt;/a&gt; while be able to view the content from the comforts of home or your desk.&lt;/p&gt;  &lt;h4&gt;Reasons to Attend&lt;/h4&gt;  &lt;p&gt;Some of the details of the event are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;More than &lt;b&gt;75 technical sessions&lt;/b&gt;&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;New! &lt;b&gt;Live sessions track&lt;/b&gt; - all live sessions, with speaker Q&amp;amp;A/interviews at the end of the day&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;b&gt;On-Demand&lt;/b&gt; access to sessions for &lt;b&gt;45 days&lt;/b&gt; - miss a session? No problem.&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Chat, Twitter Integration, SKYPE integration for Q&amp;amp;A&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Experience-based learning - find out what you need to know from people that are using the technology every day&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;These are NOT sales presentations.&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;b&gt;6-Month SSWUG.ORG Membership&lt;/b&gt; (or membership extension), included!&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;ALL-ACCESS Pass: SQL Server and Business Intelligence with related SharePoint and .NET technologies - &lt;b&gt;all included&lt;/b&gt;, one low price&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Great &lt;b&gt;vendor hall&lt;/b&gt; - learn about the best tools, technologies, publications and partners out there for your shop&lt;/em&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If that doesn’t jazz you up, then maybe know that one of the &lt;a href="http://www.brentozar.com/archive/2009/04/new-sql-server-editions-sqleditions/"&gt;best SQL Server humor threads&lt;/a&gt; started at the last SSWUG Virtual Conference.&amp;#160; &lt;/p&gt;  &lt;h4&gt;StrateSQL Sessions&lt;/h4&gt;  &lt;p&gt;I’ll be presenting four &lt;a href="http://www.vconferenceonline.com/shows/fall09/uvc/sessions.asp"&gt;sessions&lt;/a&gt; at the SSWUG Ultimate Virtual Conference.&amp;#160; My sessions will be:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Solving Business Pains with SQL Server Integration Services&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;SQL Server Integration Services (SSIS) offers a wide range of features and functionality that can be used to solve business pains within Extract, Transform, and Load (ETL) processes. These pains can be caused by the performance of current ETL process, the maintainability of ETL processes or represent a new pain that SSIS features can resolve. This presentation will provide a demonstration of real world scenarios where features of SSIS were used to solve business pains through modification of existing SSIS packages or through the creation of new SSIS packages. The session will also discuss current best practices in SSIS package design. &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Necessarily Evils, Building Optimized CRUD Procedures&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Every developer loves them and a lot of DBAs hate them. But there are many and valid reasons for creating generic SELECT, INSERT, UPDATE, and DELETE procedures. In this session, we’ll go through designing CRUD procedures that utilize new and existing SQL features to create CRUD procedures that are optimized for performance.&amp;#160; &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Improving Daily Imports with Partitioned Tables&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;At some point, everyone struggles with loading data to OLTP systems. The business needs the data loaded so that users can work through the data. But the users can’t afford the downtime to get the data into the production tables. In this session we’ll review this problem and how to use partitioning to alleviate this issue.&amp;#160; &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Are You Following Your Own Best Practices?&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Everyone has their own best practices that they try to follow. But often times we aren’t sure how well we are following our own or industry best practices. In this session we’ll go into monitoring and managing best practices throughout your environment. The session will look at how to create a solution using policy based management and other tools to report on your compliance to best practices.&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;One More Reason&lt;/h4&gt;  &lt;p&gt;For those budget conscious in the current economy, I can even offer a discount code to help nudge those that haven’t quite given in to joining the conference.&amp;#160; With these nine letters you can received a $10 discount off your registration… SPJSUVC09&lt;/p&gt;  &lt;h4&gt;The Final Pitch&lt;/h4&gt;  &lt;p&gt;I lied about the one more reason, I’ve got to give one more pitch.&lt;/p&gt;  &lt;p&gt;It’s not often that conferences give us the ability to attend all of the sessions that we want when we want to.&amp;#160; With the stellar lineup of presenters and the deep content that is flexible to each persons schedule I highly recommend attending this conference.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>September PASSMN Meeting Tonight</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/15/september-passmn-meeting-tonight.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-15:fb6ae51a-1731-485e-a91b-431191c9eabd</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="MNSSUG" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="PASS" />
		<updated>2009-09-15T14:00:00Z</updated>
		<published>2009-09-15T14:00:00Z</published>
		<content type="html">&lt;p&gt;The Minnesota SQL Server user group (PASSMN) meeting is tonight at the Microsoft offices.&amp;#160; Come check us out to network and mingle with your peers and also for the opportunity to learn some new things.&lt;/p&gt;  &lt;p&gt;Tonight’s topics are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=1745"&gt;SQL Server and Partition Alignment&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=1745"&gt;Wait-Time Based Performance Management&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you have questions or need more information on the meeting, feel free to contact me on twitter at&lt;a href="http://twitter.com/stratesql"&gt;@StrateSQL&lt;/a&gt; or though email at &lt;a href="mailto:jstrate@digineer.com"&gt;jstrate@digineer.com&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Checkout PASSMN Meeting Next Week</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/08/checkout-passmn-meeting-next-week.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-08:7864941c-7a8a-4737-a2e1-917ab25ed74f</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<category term="Performance Tuning" />
		<updated>2009-09-08T14:00:00Z</updated>
		<published>2009-09-08T14:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/060405_nequiz_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="060405_nequiz" border="0" alt="060405_nequiz" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/060405_nequiz_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Just one week until the next PASSMN meeting.&amp;#160; As I mentioned last week, this month we’ll be focusing a&amp;#160; bit on performance.&amp;#160;&amp;#160;&amp;#160; And yeah, guys with lights coming out of his body means performance… or it might be just a great party.&amp;#160; Come out and join the discussion with a snack and some great presentations.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=1745"&gt;SQL Server and Partition Alignment &amp;amp; Wait-Time Based Performance Management&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;September 15th      &lt;br /&gt;2:30 PM Networking &amp;amp; Social       &lt;br /&gt;3:00 PM Announcements       &lt;br /&gt;3:15 PM - 5:15 PM Presentations       &lt;br /&gt;      &lt;br /&gt;8300 Norman Center Drive       &lt;br /&gt;9th Floor       &lt;br /&gt;Bloomington, MN&amp;#160; 55437 &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If that wasn’t enough to make you want to want to show up, here are the presentation details…&lt;/p&gt;  &lt;h4&gt;SQL Server and Partition Alignment&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker: Jimmy May, Microsoft&lt;/strong&gt;     &lt;br /&gt;Now that SQL Server wait stats are formally documented &amp;amp; DMVs are available, disk partition alignment may be the best kept secret related to database performance optimization. In combination with stripe unit size &amp;amp; file allocation unit size, learn how you can increase I/O throughput by 10%, 30%, &amp;amp; under some circumstances even more. Many customers are unaware of partition alignment. Even experienced disk administrators may be unfamiliar with it. Explanations are often initially met with disbelief. Engineers familiar with the topic may underestimate its importance. For example, some customers think it is useful only for Microsoft Exchange Server. In fact, partition alignment is important for all servers from which high performance is expected, especially SQL Server. Each month I encounter customers with unaligned storage. Until existing misaligned partitions created using Windows Server 2003 or Windows 2000 Server are rebuilt properly, disk partition alignment will remain a relevant technology.&lt;/p&gt;  &lt;p&gt;Jimmy May&amp;#160; is a Principal Performance Engineer for Microsoft’s Assessment, Consulting, &amp;amp; Engineering (A.C.E.) Services &amp;amp; works for Team Lee. He is the Founder &amp;amp; Visionary-in-Chief of SQL Server Pros &amp;amp; was formerly the Senior Database Architect for one of the world’s largest OLTP DBs. He is a founder &amp;amp; on the executive committees of both the Indiana Windows User Group &amp;amp; Indianapolis Professional Association for SQL Server . Jimmy lives in Indianapolis, Indiana with his lovely bride, Phyllis, &amp;amp; Fannie May the Wonder Dog. Subscribe to &amp;amp; read his blog at msdn.blogs.com/jimmymay. Contact him at jimmymay@microsoft.com or aspiringgeek@live.com.    &lt;br /&gt;&lt;/p&gt;  &lt;h4&gt;Wait-Time Based Performance Management &lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker: Janis Griffin, Confio&lt;/strong&gt;     &lt;br /&gt;Using Wait Time Analysis and Wait Types is a newer method for tuning SQL Server instances. As a result, there is often confusion on exactly what the data means. The issue typically centers around the fact the wait time data is analyzed at the wrong level or the collected wait time data is not detailed enough. This presentation will focus on these problems and review several real-life case studies of using SQL Server Wait Type data coupled with Wait-Time based performance analysis to solve the most difficult performance related issues. &lt;/p&gt;  &lt;p&gt;Janis Griffin has over 20 years of DBA experience including design, development and implementation of many critical database applications. Before coming to Confio, Janis held DBA positions primarily in the Telecom Industry (15 yrs), working with both real-time network routing databases and OLTP business to business applications. &lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Report Manager in Windows 7</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/06/report-manager-in-windows-7.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-07:4b91904c-3f5b-4354-9c98-a1fb7286e8cb</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL RS" />
		<updated>2009-09-07T12:00:00Z</updated>
		<published>2009-09-07T12:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/failed-security-check-clowns-security-fail_big_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="failed-security-check-clowns-security-fail_big" border="0" alt="failed-security-check-clowns-security-fail_big" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/failed-security-check-clowns-security-fail_big_thumb.jpg" width="244" height="175" /&gt;&lt;/a&gt; While working on some questions for a project I am working on, I ran into an issue with Report Manager today.&amp;#160; I haven’t had the pleasure of running into this issue in a while and thought I would share the issue and the resolution because it affects both Windows 7 and Vista.&amp;#160; &lt;/p&gt;  &lt;p&gt;Between this time and the previous few times I’ve dealt with this, I’ve spent more than time that I should on it and it does telegraph well into a second issue that I’ll talk about at the end.&amp;#160; And the easiest way for me to remember things is to write them down.&lt;/p&gt;  &lt;h4&gt;Your First Time&lt;/h4&gt;  &lt;p&gt;When going into Report Manager for the first time after installing it on my laptop I got the following screen:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_1" border="0" alt="RM_Win7_1" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_1_thumb.jpg" width="644" height="185" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Not a very exciting screen.&amp;#160; Reporting Services is nice and secure because, as a user, I couldn’t do anything.&amp;#160; But since doing &lt;em&gt;something&lt;/em&gt; was what was needed, figuring this out was required.&lt;/p&gt;  &lt;p&gt;I started by going out and checking the Reporting Services configuration.&amp;#160; When the configuration tool is opened in Windows 7 and Vista it asks the user if they want to allow the program to make changes to the computer.&lt;/p&gt;  &lt;h4&gt;Ah-ha! Security?!&lt;/h4&gt;  &lt;p&gt;I never setup any security for Reporting Services after the installation.&amp;#160; By default, Reporting Services makes the BUILTIN\Administrators account an administrator to Reporting Services.&amp;#160; I was running Internet Explorer but I wasn’t running it as a user, not as an administrator.&amp;#160; So while I was using&lt;/p&gt;  &lt;h4&gt;Setting Up The First User&lt;/h4&gt;  &lt;p&gt;To get started, start up Internet Explorer as an administrator.&amp;#160; To do this right-click on Internet Explorer in the menu and select “Run as administrator”.&amp;#160; &lt;strike&gt;BTW, you should check out Live Mesh if you haven’t it’s great for synchronizing folders.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_3_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_3" border="0" alt="RM_Win7_3" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_3_thumb.jpg" width="644" height="231" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Next go to &lt;strong&gt;Site Settings&lt;/strong&gt; and select the &lt;strong&gt;Security&lt;/strong&gt; tab.&amp;#160; You’ll notice that only the &lt;strong&gt;BUILTIN\Administrators&lt;/strong&gt; have access after the installation.&amp;#160; This was the problem initially because Internet Explorer from regular launch didn’t acknowledge these permissions.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_4_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_4" border="0" alt="RM_Win7_4" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_4_thumb.jpg" width="644" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Select &lt;strong&gt;New Role Assignment&lt;/strong&gt; and add yourself in as a&amp;#160; &lt;strong&gt;System Administrator&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_5_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_5" border="0" alt="RM_Win7_5" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_5_thumb.jpg" width="644" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Next go to Home and select &lt;strong&gt;Properties&lt;/strong&gt; and go to the &lt;strong&gt;Security&lt;/strong&gt; tab.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_6_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_6" border="0" alt="RM_Win7_6" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_6_thumb.jpg" width="644" height="231" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160; Select &lt;strong&gt;New Role Assignment&lt;/strong&gt; and add yourself in as a&amp;#160; &lt;strong&gt;Content Manager&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_7_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_7" border="0" alt="RM_Win7_7" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_7_thumb.jpg" width="644" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now close Internet Explorer and open it back up.&amp;#160; Browse to the Reporting Services site and you should be able to do everything you expected to be able to do before.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_8_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RM_Win7_8" border="0" alt="RM_Win7_8" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/RM_Win7_8_thumb.jpg" width="644" height="231" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h4&gt;Bad Default Behavior?&lt;/h4&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now, you might be thinking this is all pointless and definitely a bug.&amp;#160; Truthfully it’s not, Internet Explorer is running under minimum permissions which you really want it to do.&amp;#160; The lower the permissions that you are cruising the internet with, the better.&amp;#160; &lt;strike&gt;Unless you like viruses then the worse.&lt;/strike&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;Also, the BUILTIN\Administrators account should be removed as a user and administrator from Reporting Services as soon as the “real” administrators have been added.&amp;#160; No sense leaving a whole in your Reporting Services site for administrators from other systems to get access to reports that they shouldn’t have access to.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Hey Minnesotans &amp;ndash; PASSMN SQL Summit</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/05/hey-minnesotans-ndash-passmn-sql-summit.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-05:49a40d1a-0de9-433a-8730-31a1d7c5b10e</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SQL 2008" />
		<category term="SQLServer" />
		<category term="MNSSUG" />
		<updated>2009-09-05T23:45:00Z</updated>
		<published>2009-09-05T23:45:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Minneapolis%20Skyline_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="Minneapolis Skyline" border="0" alt="Minneapolis Skyline" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Minneapolis%20Skyline_thumb.jpg" width="244" height="181" /&gt;&lt;/a&gt; Trying to figure out what to do between now and the &lt;a href="http://summit2009.sqlpass.org/AboutSummit/ROI/tabid/63/Default.aspx"&gt;PASS Summit&lt;/a&gt; this fall?&amp;#160; If you are hanging out in the Twin Cities, then your local PASS chapter has some new for you.&amp;#160; Announcing our first local full-day summit coming up at the end of this month.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;September 25, 2009      &lt;br /&gt;8:30 PM - 3:45 PM       &lt;br /&gt;Microsoft Office - 9th Floor       &lt;br /&gt;8300 Norman Center Drive       &lt;br /&gt;Bloomington, MN       &lt;br /&gt;Register &lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1725"&gt;Here&lt;/a&gt; or visit &lt;a href="http://www.mnssug.org/"&gt;http://www.mnssug.org/&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The day will be choke full of FREE training, networking, food, refreshments and prizes.&amp;#160; We will be having 4 different break-out sessions along 3 different tracks. Expect sessions from MVPs, vendors and everyone in between. &lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;Training for Everyone&lt;/strong&gt; &lt;/h4&gt;  &lt;p&gt;There will be 4 session times with a choice of Application Development, Database Administration and Business Intelligence. Below is the schedule of the sessions.&amp;#160; The actual session names and presenters will be available shortly.&lt;/p&gt;  &lt;h4&gt;PASSMN SQL Summit 2009 Schedule&lt;/h4&gt;  &lt;div align="center"&gt;   &lt;table border="1" cellspacing="0" cellpadding="2" width="399" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="138"&gt;8:30 to 9:30&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Registration and Breakfast &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;9:30 to 10:30&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Session 1 &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;10:30 to 10:45&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Break &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;10:45 to 11:45&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Session 2 &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;11:45 to 1:00&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Lunch &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;1:00 to 2:00&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Session 3&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;2:00 to 2:15 &lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Break with Snack &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;2:15 to 3:15&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Session 4 &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="139"&gt;3:15 to 3:45&lt;/td&gt;          &lt;td valign="top" width="259"&gt;           &lt;p align="left"&gt;Survey collection and Prizes &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h4&gt;Special Thanks to PASS and Our Members&lt;/h4&gt;  &lt;p&gt;Part of the reason this event is possible is because last year we had a large number of members that went to the PASS Summit last year and who registered as member of our user group.&amp;#160; Because of that, PASS provided us with the sponsorship that is being used for our lunch.&lt;/p&gt;  &lt;h4&gt;&lt;font color="#ff0000"&gt;Registration is Important&lt;/font&gt;&lt;/h4&gt;  &lt;p&gt;Due to the room sizes for this event we are limited to 120 attendees, be certain to &lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1725"&gt;register&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>PASSMN September Meeting</title>
		<link rel="alternate" href="http://stratesql.com/2009/09/01/passmn-september-meeting.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-09-01:a8d608bb-91cf-47fd-b8ef-1885916f4d21</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<category term="Performance Tuning" />
		<updated>2009-09-01T22:00:00Z</updated>
		<published>2009-09-01T22:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/060405_nequiz_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="060405_nequiz" border="0" alt="060405_nequiz" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/060405_nequiz_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Just two weeks away is the next PASSMN meeting.&amp;#160; This month we’ll be focusing a&amp;#160; bit on performance and to emphasis this point I found a picture of someone moving so fast that light emanates from their body.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=1745"&gt;SQL Server and Partition Alignment &amp;amp; Wait-Time Based Performance Management&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;September 15th     &lt;br /&gt;2:30 PM Networking &amp;amp; Social      &lt;br /&gt;3:00 PM Announcements      &lt;br /&gt;3:15 PM - 5:15 PM Presentations      &lt;br /&gt;      &lt;br /&gt;8300 Norman Center Drive       &lt;br /&gt;9th Floor       &lt;br /&gt;Bloomington, MN&amp;#160; 55437 &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If that wasn’t enough to make you want to want to show up, here are the presentation details…&lt;/p&gt;  &lt;h4&gt;SQL Server and Partition Alignment&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker: Jimmy May, Microsoft&lt;/strong&gt;     &lt;br /&gt;Now that SQL Server wait stats are formally documented &amp;amp; DMVs are available, disk partition alignment may be the best kept secret related to database performance optimization. In combination with stripe unit size &amp;amp; file allocation unit size, learn how you can increase I/O throughput by 10%, 30%, &amp;amp; under some circumstances even more. Many customers are unaware of partition alignment. Even experienced disk administrators may be unfamiliar with it. Explanations are often initially met with disbelief. Engineers familiar with the topic may underestimate its importance. For example, some customers think it is useful only for Microsoft Exchange Server. In fact, partition alignment is important for all servers from which high performance is expected, especially SQL Server. Each month I encounter customers with unaligned storage. Until existing misaligned partitions created using Windows Server 2003 or Windows 2000 Server are rebuilt properly, disk partition alignment will remain a relevant technology.&lt;/p&gt;  &lt;p&gt;Jimmy May&amp;#160; is a Principal Performance Engineer for Microsoft’s Assessment, Consulting, &amp;amp; Engineering (A.C.E.) Services &amp;amp; works for Team Lee. He is the Founder &amp;amp; Visionary-in-Chief of SQL Server Pros &amp;amp; was formerly the Senior Database Architect for one of the world’s largest OLTP DBs. He is a founder &amp;amp; on the executive committees of both the Indiana Windows User Group &amp;amp; Indianapolis Professional Association for SQL Server . Jimmy lives in Indianapolis, Indiana with his lovely bride, Phyllis, &amp;amp; Fannie May the Wonder Dog. Subscribe to &amp;amp; read his blog at msdn.blogs.com/jimmymay. Contact him at jimmymay@microsoft.com or aspiringgeek@live.com.   &lt;br /&gt;&lt;/p&gt;  &lt;h4&gt;Wait-Time Based Performance Management &lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker: Janis Griffin, Confio&lt;/strong&gt;     &lt;br /&gt;Using Wait Time Analysis and Wait Types is a newer method for tuning SQL Server instances. As a result, there is often confusion on exactly what the data means. The issue typically centers around the fact the wait time data is analyzed at the wrong level or the collected wait time data is not detailed enough. This presentation will focus on these problems and review several real-life case studies of using SQL Server Wait Type data coupled with Wait-Time based performance analysis to solve the most difficult performance related issues. &lt;/p&gt;  &lt;p&gt;Janis Griffin has over 20 years of DBA experience including design, development and implementation of many critical database applications. Before coming to Confio, Janis held DBA positions primarily in the Telecom Industry (15 yrs), working with both real-time network routing databases and OLTP business to business applications. &lt;/p&gt;</content>
	</entry>
	<entry>
		<title>August PASSMN Meeting Tonight</title>
		<link rel="alternate" href="http://stratesql.com/2009/08/18/august-passmn-meeting-tonight.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-08-18:5dfd36fe-c9ed-41c7-8087-3d3715a7c8c5</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<category term="DBA" />
		<updated>2009-08-18T12:00:00Z</updated>
		<published>2009-08-18T12:00:00Z</published>
		<content type="html">&lt;p&gt;The Minnesota SQL Server user group (PASSMN) meeting is tonight at the Microsoft offices.&amp;#160; Come check us out to network and mingle with your peers and also for the opportunity to learn some new things.&lt;/p&gt;  &lt;p&gt;Tonight’s topics are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1645"&gt;Syntactic Sugar Sweetens the SQL Server Pot&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1645"&gt;Discover and Manage SQL Server in the Enterprise&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you have questions or need more information on the meeting, feel free to contact me on twitter at &lt;a href="http://twitter.com/stratesql" target="_blank"&gt;@StrateSQL&lt;/a&gt; or though email at &lt;a href="mailto:jstrate@digineer.com"&gt;jstrate@digineer.com&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>This Week Only PASSMN Meeting (August 18)</title>
		<link rel="alternate" href="http://stratesql.com/2009/08/16/this-week-only-passmn-meeting-august-18.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-08-16:4fc3c1b0-57b7-4105-b317-47f540a7e4e7</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<category term="DBA" />
		<updated>2009-08-16T12:00:00Z</updated>
		<published>2009-08-16T12:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Coff_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="Coff" border="0" alt="Coff" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Coff_thumb.jpg" width="192" height="244" /&gt;&lt;/a&gt; Well… until next month of course.&amp;#160; If you’re in Minnesota and reading this… and don’t mind sharing some snacks with other like minded SQL professional… then come down and join us for this month’s SQL Server user group meeting.&lt;/p&gt;  &lt;p&gt;We’ll be in a different location for this month – across the skyway from the normal meeting spot.&amp;#160; But that puts us right over a coffee shop… not a bad tradeoff for the coffee drinkers in the the group.&lt;/p&gt;  &lt;p&gt;Without ado here are this month’s topics…&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1645"&gt;Syntactic Sugar Sweetens the SQL Server Pot &amp;amp; Discover and Manage SQL Server in the Enterprise&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;August 18, 2009    &lt;br /&gt;3:00 PM - 5:15 PM     &lt;br /&gt;&lt;strong&gt;&lt;a href="http://www.digitalconcourse.com/dropzone/MSCOMM/PASSMN/1645/FLOOR PLANS.pdf"&gt;2nd Floor Classroom&lt;/a&gt; - &lt;a href="http://www.digitalconcourse.com/dropzone/MSCOMM/PASSMN/1645/Street Map.pdf"&gt;8000 Building&lt;/a&gt;&lt;/strong&gt;     &lt;br /&gt;8000 Norman Center Drive     &lt;br /&gt;Bloomington, MN&lt;/p&gt;  &lt;h4&gt;Syntactic Sugar Sweetens the SQL Server Pot&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker:&lt;/strong&gt; Mark Knutson, Hennepin Faculty Associates &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Among the many new features of SQL Server 2005 were some SQL additions that both improve performance as well as simplify complex queries. I have used these countless times and found them quite handy. These include Common Table Expressions, the analytical ranking functions, and aggregations. I will discuss how these work and provide some SQL examples. &lt;/p&gt;    &lt;p&gt;Mark Knutson is the Senior Internet Architect at Hennepin Faculty Associates. In this capacity, he administers SQL Server and Oracle database servers, SharePoint Services, IIS, and Hyper-V virtualization server. He also leads a small development team which creates web applications using .NET and C#, and is working on the Cisco CCENT/CCNA certifications.&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Discover and Manage SQL Server in the Enterprise&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker: &lt;/strong&gt;Lara Rubbelke, Microsoft&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Do you know where SQL Server is installed in your enterprise? Are you absolutely sure you know? Really? Are you looking for a free tool to help you learn where SQL Server is installed? Once you know, are you looking for a better way to manage all of the instances in your enterprise? Learn how to leverage SQL Server 2008 features and enhancements complemented with free tools to discover and centrally manage all of the SQL Server in your enterprise. This session will dive deep into the Microsoft Assessment and Planning Toolkit and the Central Management Server, with a special focus on configuring, securing and leveraging the CMS for multi-instance management and configuration.&lt;/p&gt;    &lt;p&gt;Lara Rubbelke brings her passion for architecting, implementing and improving SQL Server solutions to the community as a Technology Specialist for Microsoft. Her expertise involves both OLTP and OLAP systems, data management, performance tuning, encryption, ETL, and the Business Intelligence lifecycle. She is an active board member of the local PASS (Professional Association for SQL Server) chapter and regularly delivers technical presentations at local, regional and national conferences, user groups and webcasts. Lara authored the Microsoft whitepaper detailing SQL Server 2005 Enterprise Edition features and was a contributing author of &amp;quot;Expert SQL Server 2005 Development&amp;quot;. Prior to joining Microsoft, Lara was a Microsoft Most Valuable Professional (MVP).&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Psst&amp;hellip; It&amp;rsquo;s Free!</title>
		<link rel="alternate" href="http://stratesql.com/2009/08/05/pssthellip-itrsquos-free.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-08-05:dcdc3a84-f8d6-47be-9329-88165348a7f7</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="Conference" />
		<category term="SQLServer" />
		<category term="PASS Summit" />
		<updated>2009-08-05T18:00:00Z</updated>
		<published>2009-08-05T18:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/screaming_baby_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="screaming_baby" border="0" alt="screaming_baby" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/screaming_baby_thumb.jpg" width="190" height="204" /&gt;&lt;/a&gt;The PASS Summit is coming up in just a few short months.&amp;#160; Have you had a chance to make your arrangement?&amp;#160; If you are like many, the down economy may be cutting into the budget that typically goes towards these events.&lt;/p&gt;  &lt;p&gt;If you hadn’t heard, the screaming baby on the side wants you to know that &lt;a href="http://www.idera.com/Content/Home.aspx"&gt;Idera&lt;/a&gt; and &lt;a href="http://www.mssqltips.com"&gt;MSSQLTips&lt;/a&gt; have teamed up with an &lt;a href="http://www.mssqltips.com/pass_giveaway_entry.asp"&gt;All Expenses Paid Trip to the SQL PASS&lt;/a&gt; Summit.&lt;/p&gt;  &lt;p&gt;The contest goes through August 25, but don’t wait until the last moment.&amp;#160; There are drinks at the happy hour with your name on it, you just need to claim them.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>August PASSMN Meeting (August 18)</title>
		<link rel="alternate" href="http://stratesql.com/2009/08/05/august-passmn-meeting-august-18.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-08-05:b16e49d3-aa08-4e48-b869-fde78f005842</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<category term="DBA" />
		<updated>2009-08-05T12:00:00Z</updated>
		<published>2009-08-05T12:00:00Z</published>
		<content type="html">&lt;h4&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Coffee-Posters_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Coffee-Posters" border="0" alt="Coffee-Posters" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Coffee-Posters_thumb.jpg" width="192" height="244" /&gt;&lt;/a&gt; &lt;/h4&gt;  &lt;p&gt;Coming up in a couple weeks is the next PASSMN meeting.&amp;#160; We’ll be in a different location for this month – across the skyway from the normal meeting spot.&amp;#160; But that puts us right over a coffee shop… not a bad tradeoff for the coffee drinkers in the the group.&lt;/p&gt;  &lt;p&gt;Without ado here are this month’s topics…&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1645"&gt;Syntactic Sugar Sweetens the SQL Server Pot &amp;amp; Discover and Manage SQL Server in the Enterprise&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;August 18, 2009    &lt;br /&gt;3:00 PM - 5:15 PM     &lt;br /&gt;&lt;strong&gt;&lt;a href="http://www.digitalconcourse.com/dropzone/MSCOMM/PASSMN/1645/FLOOR PLANS.pdf"&gt;2nd Floor Classroom&lt;/a&gt; - &lt;a href="http://www.digitalconcourse.com/dropzone/MSCOMM/PASSMN/1645/Street Map.pdf"&gt;8000 Building&lt;/a&gt;&lt;/strong&gt;     &lt;br /&gt;8000 Norman Center Drive     &lt;br /&gt;Bloomington, MN&lt;/p&gt;  &lt;h4&gt;Syntactic Sugar Sweetens the SQL Server Pot&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker:&lt;/strong&gt; Mark Knutson, Hennepin Faculty Associates &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Among the many new features of SQL Server 2005 were some SQL additions that both improve performance as well as simplify complex queries. I have used these countless times and found them quite handy. These include Common Table Expressions, the analytical ranking functions, and aggregations. I will discuss how these work and provide some SQL examples. &lt;/p&gt;    &lt;p&gt;Mark Knutson is the Senior Internet Architect at Hennepin Faculty Associates. In this capacity, he administers SQL Server and Oracle database servers, SharePoint Services, IIS, and Hyper-V virtualization server. He also leads a small development team which creates web applications using .NET and C#, and is working on the Cisco CCENT/CCNA certifications.&lt;/p&gt; &lt;/blockquote&gt;  &lt;h4&gt;Discover and Manage SQL Server in the Enterprise&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Speaker: &lt;/strong&gt;Lara Rubbelke, Microsoft&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Do you know where SQL Server is installed in your enterprise? Are you absolutely sure you know? Really? Are you looking for a free tool to help you learn where SQL Server is installed? Once you know, are you looking for a better way to manage all of the instances in your enterprise? Learn how to leverage SQL Server 2008 features and enhancements complemented with free tools to discover and centrally manage all of the SQL Server in your enterprise. This session will dive deep into the Microsoft Assessment and Planning Toolkit and the Central Management Server, with a special focus on configuring, securing and leveraging the CMS for multi-instance management and configuration.&lt;/p&gt;    &lt;p&gt;Lara Rubbelke brings her passion for architecting, implementing and improving SQL Server solutions to the community as a Technology Specialist for Microsoft. Her expertise involves both OLTP and OLAP systems, data management, performance tuning, encryption, ETL, and the Business Intelligence lifecycle. She is an active board member of the local PASS (Professional Association for SQL Server) chapter and regularly delivers technical presentations at local, regional and national conferences, user groups and webcasts. Lara authored the Microsoft whitepaper detailing SQL Server 2005 Enterprise Edition features and was a contributing author of &amp;quot;Expert SQL Server 2005 Development&amp;quot;. Prior to joining Microsoft, Lara was a Microsoft Most Valuable Professional (MVP).&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Reminder! Oct 21 &amp;ndash; IT Care - Painting by Numbers, Update Your SQL Skills with New Paintbrushes</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/11/oct-21-ndash-it-care--painting-by-numbers-update-your-sql-skills-with-new-paintbrushes.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-08-03:c2fe20b5-b373-4ea0-b4d8-a0e63ff256b4</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Tools and Tips" />
		<category term="Conference" />
		<category term="Performance Tuning" />
		<updated>2009-08-03T16:29:00Z</updated>
		<published>2009-08-03T16:29:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/star_wars_paint_by_numbers_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="star_wars_paint_by_numbers" border="0" alt="star_wars_paint_by_numbers" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/star_wars_paint_by_numbers_thumb.jpg" width="212" height="143" /&gt;&lt;/a&gt; I mentioned this a couple months back.&amp;#160; If you are looking for a &lt;a href="http://en.wikipedia.org/wiki/Freegan" target="_blank"&gt;free&lt;/a&gt; event to discover more ways to write T-SQL here is an event for you.&amp;#160; The session will be hosted by yours truly and features T-SQL tricks and tips that I’ve picked up and want to spread the word on.&lt;/p&gt;  &lt;p&gt;Here is the registration &lt;a href="http://www.nhmn.com/Courses/CrsDetail.aspx?C=NHITCare102109" target="_blank"&gt;link&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;And the details:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Course Overview&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;ITCare, delivered and hosted quarterly by our Partners is designed to keep you up to date on the cutting-edge technologies. ITCare is a FREE half-day technical seminar series created by IT Professionals for IT Professionals! We'll address the needs and issues today and show you how to make a real difference in the way that you work.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;While not everyone may not be a great painter, there is an art form to writing great SQL statements. In this session we'll go over tips and tricks in writing SQL. We'll also review some popular bad practices and provide demonstrations to better change those velvet Elvis's to Rembrandts. As every paint brush can't produce a masterpiece, the same goes for SQL statements. Writing good SQL code requires the right brush. After this session, you'll have a few more paintbrushes and probably throw out a few that are no longer useful.&lt;/p&gt; 1. Review and discussion of common coding methods can impact performance.     &lt;br /&gt;2. Discussion of uncommon coding methods that can be used to improve performance.     &lt;br /&gt;3. Review and application of existing T-SQL functions.     &lt;p&gt;&lt;strong&gt;Audience&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Junior to mid-level SQL Server developers&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Understanding of basic T-SQL coding skills.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Course Price&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;$0.00&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Topics&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Speaker: Jason Strate of Digineer, Inc. Jason Strate has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft's published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition and actively blogs about SQL Server and related technologies. Also this past year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008 and presented at the SSWUG SQL Server Launch Event and the last two SSWUG Virtual SQL Server Conferences.&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Analyzing Report Execution Time</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/31/analyzing-report-execution-time.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-31:2f2fd010-a168-4d3c-b910-ad216db5d10e</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL RS" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<updated>2009-07-31T12:08:00Z</updated>
		<published>2009-07-31T12:08:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/fob_watch2_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="fob_watch2" border="0" alt="fob_watch2" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/fob_watch2_thumb.jpg" width="190" height="142" /&gt;&lt;/a&gt;One of the reasons I was digging around to find out &lt;a href="http://stratesql.com/2009/07/30/finding-number-of-reports-executed-by-folder.aspx"&gt;how many reports were being executed for each folder&lt;/a&gt; the other day was that there were some subscription issues at the client.&amp;#160; The goal was to get a break down of when reports were being executed and generally who’s reports they were.&lt;/p&gt;  &lt;p&gt;With that information in hand the topic quickly shifted to which reports were taking the most resources on the Reporting Services instance.&amp;#160; There are a number of ways to go about this but for this case I wanted to know how long it took from the when the report was requested until it was delivered to the user.&lt;/p&gt;  &lt;p&gt;Like in the last post, this information can be gleamed from the &lt;a href="http://msdn.microsoft.com/en-us/library/ms159110.aspx"&gt;ExecutionLog&lt;/a&gt; table in the Report Server database.&amp;#160; There are five columns that I use to get execution time information:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;TimeStart – Time that the report execution begins&lt;/li&gt;    &lt;li&gt;TimeEnd – Time that the report execution completes&lt;/li&gt;    &lt;li&gt;TimeDataRetrieval- Time spent running retrieving data from data sources&lt;/li&gt;    &lt;li&gt;TimeProcessing – Time spent processing the report&lt;/li&gt;    &lt;li&gt;TimeRendering - Time spent rendering the report in the requested format&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note: that the execution time for the report for TimeDataRetrieval, TimeProcessing, and TimeRendering does not equal the difference between TimeStart and TimeEnd.&amp;#160; This is because there are other operations performed while executing and returning reports that are not tracked.&lt;/p&gt;  &lt;p&gt;As with the other script, this query also includes start and end dates.&amp;#160; Here is the script:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @StartDate datetime
    ,@EndDate datetime

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @StartDate = &lt;span style="color: #006080"&gt;'1/1/2009'&lt;/span&gt;
    ,@EndDate = &lt;span style="color: #006080"&gt;'12/31/2009'&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; c.name
    ,c.&lt;span style="color: #0000ff"&gt;Path&lt;/span&gt;
    ,&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; Executions
    ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;AVG&lt;/span&gt;(DATEDIFF(ms, TimeStart, TimeEnd)*1.)&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; AverageExecutionTime
    ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(el.TimeDataRetrieval)/(&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*)*1.) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; AverageTimeDataRetrieval
    ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(el.TimeProcessing)/(&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*)*1.) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; AverageTimeProcessing
    ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(el.TimeRendering)/(&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*)*1.) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; AverageTimeRendering
    ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #006080"&gt;' Count = &amp;quot;'&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;) + &lt;span style="color: #006080"&gt;'&amp;quot;'&lt;/span&gt;
            + &lt;span style="color: #006080"&gt;' Value = &amp;quot;'&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(iel.&lt;span style="color: #0000ff"&gt;Parameters&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)), &lt;span style="color: #006080"&gt;'-NONE-'&lt;/span&gt;) + &lt;span style="color: #006080"&gt;'&amp;quot;'&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Parameters&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.ExecutionLog iel
        &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; iel.TimeStart &lt;span style="color: #0000ff"&gt;BETWEEN&lt;/span&gt; &lt;span style="color: #0000ff"&gt;MIN&lt;/span&gt;(el.TimeStart) &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(el.TimeStart)
        &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; iel.ReportID = el.ReportID
        &lt;span style="color: #0000ff"&gt;GROUP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;COALESCE&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(iel.&lt;span style="color: #0000ff"&gt;Parameters&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)), &lt;span style="color: #006080"&gt;'-NONE-'&lt;/span&gt;)
        &lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;COUNT&lt;/span&gt;(*) &lt;span style="color: #0000ff"&gt;DESC&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML &lt;span style="color: #0000ff"&gt;PATH&lt;/span&gt;(&lt;span style="color: #006080"&gt;''&lt;/span&gt;)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; xml) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Parameters&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.ExecutionLog el
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; dbo.&lt;span style="color: #0000ff"&gt;Catalog&lt;/span&gt; c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; el.ReportID = c.ItemID
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; el.TimeStart &lt;span style="color: #0000ff"&gt;BETWEEN&lt;/span&gt; @StartDate &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; @EndDate
&lt;span style="color: #0000ff"&gt;GROUP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; c.name, c.&lt;span style="color: #0000ff"&gt;Path&lt;/span&gt;, el.ReportID
&lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(el.TimeDataRetrieval) DESC&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Running the script on my laptop shows the reports that have been executed.&amp;#160; As you can tell, I am a reporting fiend.&amp;#160; Take a look at the output below&amp;quot;:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssrs2_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ssrs2" border="0" alt="ssrs2" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/ssrs2_thumb.jpg" width="653" height="39" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Do note the last column.&amp;#160; This column has an XML document that summarizes all of the parameter variations that were used to with the report in the given timeframe with a count of the number of executions.&amp;#160; For my purposes, I looked at the reports that were executed most frequently.&lt;/p&gt;

&lt;p&gt;When I clicked on the XML link in the first row, it opened the following document:&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;Parameters&amp;gt; Count = &lt;span style="color: #006080"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; Value = &lt;span style="color: #006080"&gt;&amp;quot;ShowDescription=False&amp;amp;amp;StartDate=01/01/2002 00:00:00&amp;amp;amp;EndDate=12/31/2003 00:00:00&amp;quot;&lt;/span&gt;&amp;lt;/Parameters&amp;gt;
&amp;lt;Parameters&amp;gt; Count = &lt;span style="color: #006080"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; Value = &lt;span style="color: #006080"&gt;&amp;quot;ShowDescription=False&amp;amp;amp;StartDate=1/1/2002 12:00:00 AM&amp;amp;amp;EndDate=12/31/2003 12:00:00 AM&amp;quot;&lt;/span&gt;&amp;lt;/Parameters&amp;gt;
&amp;lt;Parameters&amp;gt; Count = &lt;span style="color: #006080"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; Value = &lt;span style="color: #006080"&gt;&amp;quot;ShowDescription=False&amp;amp;amp;StartDate=1/15/2002 12:00:00 AM&amp;amp;amp;EndDate=12/31/2003 12:00:00 AM&amp;quot;&lt;/span&gt;&amp;lt;/Parameters&amp;gt;
&amp;lt;Parameters&amp;gt; Count = &lt;span style="color: #006080"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; Value = &lt;span style="color: #006080"&gt;&amp;quot;ShowDescription=False&amp;amp;amp;StartDate=6/15/2002 12:00:00 AM&amp;amp;amp;EndDate=12/31/2003 12:00:00 AM&amp;quot;&lt;/span&gt;&amp;lt;/Parameters&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I’ve found that this query to be quite helpful in finding both the high execution time reports along with sample parameter strings that can be used to performance test the reports.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Finding Number of Reports Executed By Folder</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/30/finding-number-of-reports-executed-by-folder.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-30:01fd14e8-01c1-42ba-b77a-5b64e1825d9a</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL RS" />
		<category term="SQL 2005" />
		<updated>2009-07-30T13:00:00Z</updated>
		<published>2009-07-30T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Pile-771824m_2.gif"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Pile-771824m" border="0" alt="Pile-771824m" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Pile-771824m_thumb.gif" width="149" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;While working with a client a couple weeks back, I was asked to determine the count of reports that were being executed under each folder off the root directory on the Reporting Services instance.&amp;#160; Each of the folders off the root directory represented a department at the client.&lt;/p&gt;  &lt;p&gt;For the output, I decided that I wanted to break out the reports executed by each hour of the day to see where the traffic was occurring.&amp;#160; Then the columns would be named after the first level folders off the root directory with counts of the number of reports executed under each folder.&lt;/p&gt;  &lt;p&gt;The script is setup to take any date range you’d like.&amp;#160; In the case with the client, I was looking at that data for the first of the month.&amp;#160; In the script below, I expanded it to execute for the entire year.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @StartDate datetime
    ,@EndDate datetime

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @StartDate = &lt;span style="color: #006080"&gt;'1/1/2009'&lt;/span&gt;
    ,@EndDate = &lt;span style="color: #006080"&gt;'12/31/2009'&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @ColumnList &lt;span style="color: #0000ff"&gt;table&lt;/span&gt; (FirstLevelFolder nvarchar(128))

INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @ColumnList
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;DISTINCT&lt;/span&gt; REPLACE(&lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;Path&lt;/span&gt;, CHARINDEX(&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;,&lt;span style="color: #0000ff"&gt;Path&lt;/span&gt; + &lt;span style="color: #006080"&gt;'/'&lt;/span&gt;,2)),&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;,&lt;span style="color: #006080"&gt;''&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; dbo.ExecutionLog el
      &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; dbo.&lt;span style="color: #0000ff"&gt;Catalog&lt;/span&gt; c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; el.ReportID = c.ItemID
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; el.TimeStart &lt;span style="color: #0000ff"&gt;BETWEEN&lt;/span&gt; @StartDate &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; @EndDate
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Path&lt;/span&gt; &amp;lt;&amp;gt; &lt;span style="color: #006080"&gt;''&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @Columns nvarchar(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)
      ,@&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; nvarchar(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)
      
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @Columns = STUFF((
      &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #006080"&gt;','&lt;/span&gt; + QUOTENAME(FirstLevelFolder)
      &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; @ColumnList
      &lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; FirstLevelFolder
      &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML &lt;span style="color: #0000ff"&gt;PATH&lt;/span&gt;(&lt;span style="color: #006080"&gt;''&lt;/span&gt;)      
      ), 1, 1, &lt;span style="color: #006080"&gt;''&lt;/span&gt;) 

&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; = &lt;span style="color: #006080"&gt;'SELECT StartHour, '&lt;/span&gt; 
      + @Columns 
      + &lt;span style="color: #006080"&gt;'FROM (
            SELECT DATEPART(hh, TimeStart) as StartHour, REPLACE(LEFT(Path, CHARINDEX('&lt;/span&gt;&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;&lt;span style="color: #006080"&gt;',Path,2)),'&lt;/span&gt;&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;&lt;span style="color: #006080"&gt;','&lt;/span&gt;&lt;span style="color: #006080"&gt;''&lt;/span&gt;&lt;span style="color: #006080"&gt;') as Path, COUNT(*) as Executions
            FROM dbo.ExecutionLog el
                  INNER JOIN dbo.Catalog c ON el.ReportID = c.ItemID
            WHERE el.TimeStart BETWEEN @StartDate AND @EndDate
            GROUP BY DATEPART(hh, el.TimeStart), REPLACE(LEFT(Path, CHARINDEX('&lt;/span&gt;&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;&lt;span style="color: #006080"&gt;',Path,2)),'&lt;/span&gt;&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;&lt;span style="color: #006080"&gt;','&lt;/span&gt;&lt;span style="color: #006080"&gt;''&lt;/span&gt;&lt;span style="color: #006080"&gt;')) x '&lt;/span&gt; 
      + &lt;span style="color: #006080"&gt;'PIVOT '&lt;/span&gt; + 
      + &lt;span style="color: #006080"&gt;'(SUM(Executions) FOR Path IN ('&lt;/span&gt; + @Columns + &lt;span style="color: #006080"&gt;')) AS pt;'&lt;/span&gt;; 

&lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; sp_executesql @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'@StartDate datetime, @EndDate datetime'&lt;/span&gt;, @StartDate = @StartDate, @EndDate = @EndDate&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;There are two things to take away from this script.&amp;#160; The first is that logging in the reporting services provides a lot of information that can be used to see what the users are doing.&amp;#160; And second, with a little dynamic SQL data can be pivoted without knowing what the end columns will be.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>The Sixth Sense</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/29/the-sixth-sense.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-29:fec4f7b9-9c57-4271-aba2-5833407a6b5f</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<updated>2009-07-29T22:15:00Z</updated>
		<published>2009-07-29T22:15:00Z</published>
		<content type="html">&lt;p&gt;This is an amazing technology concept.&amp;#160; It is a little ugly at the moment, but I bet that once it hits the design phase it will look pretty cool.&amp;#160; Maybe they’ll be able to shrink it into a pair of sunglasses.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px auto; padding-left: 0px; width: 425px; padding-right: 0px; display: block; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:b197c41d-6767-4151-9a45-368e39b6dd2c" class="wlWriterEditableSmartContent"&gt;&lt;div id="ae1788a3-9b9a-404e-976e-606245e740b8" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=blBohrmyo-I" target="_new"&gt;&lt;img src="http://stratesql.com/images/0/0/5/8/4/157902-148500/video8ba1bc27bd29.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('ae1788a3-9b9a-404e-976e-606245e740b8'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/blBohrmyo-I&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/blBohrmyo-I&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>PASSMN SQL Summit 2009 &amp;ndash; Call For Presenters</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/29/passmn-sql-summit-2009-ndash-call-for-presenters.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-29:9d521563-08a4-484a-ad17-eb58f5ab5d17</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SQLServer" />
		<category term="MNSSUG" />
		<category term="Conference" />
		<updated>2009-07-29T14:00:00Z</updated>
		<published>2009-07-29T14:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/PASSMNLOGO_white_2.gif"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="PASSMNLOGO_white" border="0" alt="PASSMNLOGO_white" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/PASSMNLOGO_white_thumb.gif" width="204" height="84" /&gt;&lt;/a&gt; If you’ve been coming to the monthly &lt;a href="http://www.mnssug.org"&gt;PASSMN&lt;/a&gt; meetings then you’ve heard that we are planning to have a full day SQL Server event.&amp;#160; The general details are that the event will be at Microsoft’s Offices on Friday, September 29, 2009.&lt;/p&gt;  &lt;p&gt;We are still putting details together for the event and part of that means finding presenters.&amp;#160; And without further ado, if you’d like to present at the PASSMN SQL Summit 2009 (&lt;strike&gt;yeah, were hoping to be starting something here&lt;/strike&gt;) please let us know by completing the following survey:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.surveymonkey.com/s.aspx?sm=d62sRu_2bCNdbkndwPEderRw_3d_3d"&gt;PASSMN SQL Summit 2009&amp;#160; - Call for Presenters&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Maybe you aren’t much of a speaker but have a good idea what types of sessions we should be looking for.&amp;#160; We also have a survey for you:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.surveymonkey.com/s.aspx?sm=2nSG8Dv_2ftQkdDIqo9_2f0LqA_3d_3d"&gt;PASSMN SQL Summit 2009&amp;#160; - Request for Sessions&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you are interested in the event and have questions, feel free to contact me (&lt;a href="mailto:jstrate@digineer.com"&gt;email&lt;/a&gt; | &lt;a href="http://twitter.com/stratesql"&gt;twitter&lt;/a&gt;).&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Gotta Stop Violating Foreign Keys</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/29/gotta-stop-violating-foreign-keys.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-29:1846bec6-5c7c-4706-b10d-b240b07a372b</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<updated>2009-07-29T12:00:00Z</updated>
		<published>2009-07-29T12:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Key%20Shape%20Steel%20Bottle%20Opener2-20090709170142_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="Key Shape Steel Bottle Opener2-20090709170142" border="0" alt="Key Shape Steel Bottle Opener2-20090709170142" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Key%20Shape%20Steel%20Bottle%20Opener2-20090709170142_thumb.jpg" width="129" height="166" /&gt;&lt;/a&gt;About a year ago I was working on a project that required that data be extracted from one database and inserted into an database.&amp;#160; Not the most earth shattering concept.&amp;#160; This is done quite often and doesn’t necessarily require a discussion of foreign keys.&lt;/p&gt;  &lt;p&gt;So why talk about them… well… in this case the source and the destination databases were identical. They had the same table and foreign key structure.&amp;#160; But no reason to be sold on this discussion quite yet… because it would be east to just build the ETL process around this.&amp;#160; It would need to be built with the ordering of the tables controlled with precedence constraints or inserts statements in the proper order.&lt;/p&gt;  &lt;p&gt;So here’s the rub… this process needed to move data between hundreds of tables.&amp;#160; When hundreds of tables are in the discussion, I lose interest very quickly in trying to determine by hand how to order the tables.&amp;#160; I did in this case and looked for a method to accomplish this through foreign key meta data.&lt;/p&gt;  &lt;p&gt;And of course, there wouldn’t be a post if there wasn’t an answer.&amp;#160; &lt;strike&gt;Well, maybe I’d post a question, but I not so nanner nanner.&lt;/strike&gt;&amp;#160; The solution uses a function with a query to get the necessary data.&amp;#160; There might be better ways to do this, but this way worked quite well and had pretty decent performance.&amp;#160; One variation of this used a single CTE that I let run for a couple hours before I decided it was running sub-optimal.&lt;/p&gt;  &lt;p&gt;There are two caveats with this solution:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Self-referencing foreign keys will cause a recursion error.&amp;#160; When row A needs to be inserted before row B can’t really be helped through metadata.&amp;#160; Since the environment I was working in didn’t have this issue, the solution didn’t address it either.&lt;/li&gt;    &lt;li&gt;Circular-referencing foreign keys will also cause a recursion error.&amp;#160; There are situations where table A references table B which references table C which then references table A.&amp;#160; I run into these from time to time but not in the environment that this was designed for.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;With the caveats out of the way, here is the solution:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.objects &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; object_id = OBJECT_ID(N&lt;span style="color: #006080"&gt;'[dbo].[ListFKParents]'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; type &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; (N&lt;span style="color: #006080"&gt;'FN'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'IF'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'TF'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'FS'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'FT'&lt;/span&gt;))
&lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FUNCTION&lt;/span&gt; [dbo].[ListFKParents]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

/*================================================================================
&lt;span style="color: #0000ff"&gt;Function&lt;/span&gt;:    dbo.ListFKParents
Author:        Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        July 23, 2009

Synopsis:
    This &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; &lt;span style="color: #0000ff"&gt;returns&lt;/span&gt; a comma separated list &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; parents &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; a &lt;span style="color: #0000ff"&gt;table&lt;/span&gt;.

================================================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;            Description
--------------------------------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
================================================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FUNCTION&lt;/span&gt; [dbo].[ListFKParents] (@ObjectID &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) 
&lt;span style="color: #0000ff"&gt;RETURNS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;table&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; 
&lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt; (
&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; cteParentChild (Object_ID, parent_Object_ID, referenced_Object_ID, name) 
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; 
( 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; fk.parent_Object_ID, t1.name, fk.referenced_Object_ID, t2.name 
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.foreign_keys fk 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.tables t1 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.parent_Object_ID = t1.Object_ID 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.tables t2 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.referenced_Object_ID = t2.Object_ID 
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; t1.Object_ID = @ObjectID
&lt;span style="color: #0000ff"&gt;UNION&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ALL&lt;/span&gt; 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; fk.parent_Object_ID, t1.name, fk.referenced_Object_ID, t2.name 
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.foreign_keys fk 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.tables t1 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.parent_Object_ID = t1.Object_ID 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.tables t2 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.referenced_Object_ID = t2.Object_ID 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; cteParentChild cte &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; cte.referenced_Object_ID = fk.parent_Object_ID 
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; fk.referenced_Object_ID &amp;lt;&amp;gt; fk.parent_Object_ID 
) 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #006080"&gt;','&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(50), x.referenced_Object_ID) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; [text()]
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; cteParentChild x 
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; x.referenced_Object_ID &amp;lt;&amp;gt; @ObjectID
&lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; x.referenced_Object_ID 
&lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML &lt;span style="color: #0000ff"&gt;PATH&lt;/span&gt; (&lt;span style="color: #006080"&gt;''&lt;/span&gt;)) + &lt;span style="color: #006080"&gt;','&lt;/span&gt; &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; FKParents
)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'tempdb..#ParentChild'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #ParentChild 

&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #ParentChild 
    ( 
    object_id &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;
    ,name sysname
    ,parents &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;) 
    ) 

--List &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; tables &lt;span style="color: #0000ff"&gt;and&lt;/span&gt; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; a list &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; the parent tables &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; the &lt;span style="color: #0000ff"&gt;table&lt;/span&gt;
INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; #ParentChild 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; object_id, name, x.FKParents
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.tables t
    &lt;span style="color: #0000ff"&gt;CROSS&lt;/span&gt; APPLY dbo.ListFKParents(object_id) x

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'tempdb..#TableOrder'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #TableOrder 

&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #TableOrder 
    ( 
    object_id &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;
    ,name sysname
    ,rank &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; 
    ) 

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @Loop &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; 
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; @Loop = 0 

--Insert &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; tables &lt;span style="color: #0000ff"&gt;with&lt;/span&gt; &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; parents &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; 0-&lt;span style="color: #0000ff"&gt;level&lt;/span&gt; rank
INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; #TableOrder 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; object_id, name, @Loop 
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #ParentChild 
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; parents &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; 

&lt;span style="color: #0000ff"&gt;WHILE&lt;/span&gt; 1=1 
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; @Loop = @Loop + 1 

--Remove &lt;span style="color: #0000ff"&gt;any&lt;/span&gt; items that &lt;span style="color: #0000ff"&gt;are&lt;/span&gt; &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; #TableOrder &lt;span style="color: #0000ff"&gt;and&lt;/span&gt; &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; #ParentChild
    &lt;span style="color: #0000ff"&gt;DELETE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #ParentChild 
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; object_id &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; object_id &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #TableOrder) 

    ;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; cteParentChild (varchar_object_id, object_id, name, parents) 
    &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; 
    ( 
--&lt;span style="color: #0000ff"&gt;Select&lt;/span&gt; items that &lt;span style="color: #0000ff"&gt;match&lt;/span&gt; &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; parent #TableOrder &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; #ParentChild
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;DISTINCT&lt;/span&gt; &lt;span style="color: #006080"&gt;'%,'&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(50),t.object_id) + &lt;span style="color: #006080"&gt;',%'&lt;/span&gt;, t.*
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #ParentChild t 
        &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; ( 
                &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #006080"&gt;'%,'&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(50),object_id) + &lt;span style="color: #006080"&gt;',%'&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; object_id 
                &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #TableOrder 
                ) x &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; parents &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; x.object_id 
    ) 
--Insert items &lt;span style="color: #0000ff"&gt;into&lt;/span&gt; that have &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; parents &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; #TableOrder
    INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; #TableOrder 
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; pc1.object_id, pc1.name, @Loop 
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; cteParentChild pc1 
        &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; cteParentChild pc2 &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; pc1.parents &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; pc2.varchar_object_id 
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; pc2.varchar_object_id &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; 

    &lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #cc6633"&gt;@@RowCount&lt;/span&gt; = 0 
        &lt;span style="color: #0000ff"&gt;BREAK&lt;/span&gt; 
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt; 

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * 
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #TableOrder 
&lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; rank, name&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Happy hunting.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Apply Those Updates</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/23/apply-those-updates.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-23:36cd0b65-f780-4f3a-92e5-42548f2ba708</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBA" />
		<updated>2009-07-23T12:00:00Z</updated>
		<published>2009-07-23T12:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/makeup-main_Full_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="makeup-main_Full" border="0" alt="makeup-main_Full" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/makeup-main_Full_thumb.jpg" width="188" height="122" /&gt;&lt;/a&gt;Staying on top of patches for your applications can be important, especially when those patches can fix issues that are currently affecting your environment.&amp;#160; I’ve run into this from time to time with where the fix for an issue is related to the current state of updates to the SQL Server instance.&lt;/p&gt;  &lt;p&gt;If the data on the SQL Servers wasn’t important, we wouldn’t be putting it into databases.&amp;#160; Because of that the servers need to be taken care of and kept up to date.&amp;#160; Like make-up, over the course of time things can happen.&amp;#160; Things like a little moisture around the eyes causing mascara to run or the discovery of a new bug that causes the server to require a reboot.&amp;#160; The fix for both is to apply an update.&amp;#160; &lt;strike&gt;Wouldn’t it be cool if lipstick on a server fixed bugs.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;To stay on top of Service Packs and Cumulative Updates, check out the &lt;a href="http://blogs.msdn.com/sqlreleaseservices/default.aspx"&gt;Microsoft SQL Server Release Services&lt;/a&gt; blog.&amp;#160; By following them you would have found out that Monday the following items came out:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/sqlreleaseservices/archive/2009/07/20/cumulative-update-3-for-sql-server-2008-sp1.aspx"&gt;Cumulative Update #3 for SQL Server 2008 SP1&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/sqlreleaseservices/archive/2009/07/20/cumulative-update-6-for-sql-server-2008-rtm.aspx"&gt;Cumulative Update #6 for SQL Server 2008 RTM&lt;/a&gt;&lt;/li&gt; &lt;/ol&gt;</content>
	</entry>
	<entry>
		<title>Management Data Warehouse Whitepaper</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/22/management-data-warehouse-whitepaper.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-22:419ad7b1-7ce2-4e0a-a861-03b91e9042ba</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQL 2008" />
		<category term="WhitePaper" />
		<category term="SQLServer" />
		<category term="Performance Tuning" />
		<category term="DBA" />
		<updated>2009-07-23T04:02:00Z</updated>
		<published>2009-07-23T04:02:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/heart_beat_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="heart_beat" border="0" alt="heart_beat" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/heart_beat_thumb.jpg" width="162" height="118" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One of SQL Server 2008 features I’ve been especially thrilled about is the &lt;a href="http://msdn.microsoft.com/en-us/library/bb677306.aspx"&gt;Management Data Warehouse (MDW)&lt;/a&gt;.&amp;#160; Just recently, Microsoft released a &lt;a href="http://msdn.microsoft.com/en-us/library/dd939169.aspx"&gt;white paper&amp;#160; by Kalen Delany&lt;/a&gt; that goes into a bit a depth on MDW and covers some best practices and things to watch out for.&lt;/p&gt;  &lt;p&gt;Happy reading!&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>I Had a Dream, too!</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/21/i-had-a-dream-too.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-21:e2cf3b5c-9f73-4068-b1e7-9478d44a21ec</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="PASS Summit" />
		<category term="Conference" />
		<updated>2009-07-21T17:00:00Z</updated>
		<published>2009-07-21T17:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/i_have_a_dream_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="i_have_a_dream" border="0" alt="i_have_a_dream" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/i_have_a_dream_thumb.jpg" width="244" height="157" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Some people have dreams and they talk about them and an entire generation is changed.&amp;#160; Things line up and world is a lot different than the day before just because of a little dream.&lt;/p&gt;  &lt;p&gt;I dream, too.&amp;#160; But my dreams aren’t so grand.&amp;#160; I tend to dream about SQL Server professionals coming together to network, tell jokes, listen, and learn about SQL Server and things related to working in a field full of data.&lt;/p&gt;  &lt;p&gt;The nice thing about my dream is that I don’t have wait for the world to change.&amp;#160; My dream happens once a year at the &lt;a href="http://summit2009.sqlpass.org/"&gt;PASS Community Summit&lt;/a&gt;.&amp;#160; &lt;strike&gt;You already registered, right?&lt;/strike&gt;&amp;#160; But, wouldn’t you know…like most anyone that realizes a dream I want more.&amp;#160; I want it all.&amp;#160; I want it every day.&lt;/p&gt;  &lt;p&gt;And I can get more.&amp;#160; And you can get more.&amp;#160; How does this happen you might ask?&lt;/p&gt;  &lt;p&gt;Go ahead an ask…&lt;/p&gt;  &lt;p&gt;The answer is by attending the &lt;a href="http://www.vconferenceonline.com/shows/summer09/uvc/default.asp?id=162"&gt;SSWUG.ORG Summer Refresher Virtual Conference&lt;/a&gt;.&amp;#160; Check out these details:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;120 sessions&lt;/strong&gt; by industry experts in Business Intelligence, SQL Server, SharePoint and .NET Development are all available. These sessions are the best of the best - and selected by the community for this conference. &lt;/p&gt;    &lt;p&gt;We are also including live sessions presented by Chris Shaw and Stephen Wynkoop detailing top 20 scripts, performance tips, and things that people should know about SQL Server.&amp;#160; In addition, Q&amp;amp;A sessions each day will be included where you can ask questions live. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You get to watch pre-recorded sessions and participate in a live Q&amp;amp;A with the presenter.&amp;#160; No waiting for the end of the session to answer your immediate question.&amp;#160; Get the answers when the question arises.&amp;#160; And with all of the other people joining in on the chat you get a conversation between everyone that goes beyond the Q&amp;amp;A with the presenter.&lt;/p&gt;  &lt;p&gt;Now here’s the rub… it starts tomorrow and goes through Friday.&amp;#160; Oh my!&amp;#160; You may be thinking… you have meetings scheduled and can’t attend all day from the remainder of the week.&lt;/p&gt;  &lt;p&gt;That is, like so, not a problem. &lt;strike&gt;yeah, I brought in valley&amp;#160; girl speak here, I’m digging deep.&lt;/strike&gt;&amp;#160; After the sessions have been broadcast you can log back in and watch them again later and catch all of the content that you missed.&lt;/p&gt;  &lt;p&gt;So get some popcorn and get registered.&amp;#160; Hope to see some people in my sessions.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Moving to the Head of the Line</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/21/moving-to-the-head-of-the-line.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-21:1dd8d1ab-7ed6-4f35-b51f-48fee8ab2ae6</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="Certification" />
		<category term="Career" />
		<updated>2009-07-21T12:00:00Z</updated>
		<published>2009-07-21T12:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/Line_after_line_540x404.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Line_after_line_540x404" border="0" alt="Line_after_line_540x404" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/Line_after_line_540x404_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt;Jobs aren’t a dime a&amp;#160; dozen like they used to be during the dot-com bubble.&amp;#160; These days the unemployment rate is heading to territory that hasn’t been seen in decades.&amp;#160; With some states seeming unemployment rates &lt;a href="http://www.bloomberg.com/apps/news?pid=20601087&amp;amp;sid=aOor3cUkmexE"&gt;as high as 15%&lt;/a&gt;.&amp;#160; It becomes more important with every interview to differentiate yourself from the pack.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Differentiate Yourself&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;To help people differentiate themselves from others, Microsoft is introduced a program called &lt;a href="http://www.microsoft.com/click/thrive/?view=html"&gt;Thrive&lt;/a&gt;.&amp;#160; This program is designed to help you align your career and goals with your skills and passions.&lt;/p&gt;  &lt;p&gt;Part of the focus of the Thrive program is on certifications.&amp;#160; I’ve discussed why I think certifications are important in &lt;a href="http://stratesql.com/2009/05/18/your-2nd-chance-end-june-30.aspx"&gt;other posts&lt;/a&gt;,&amp;#160; so I won’t go into that here.&amp;#160; But the program also focuses on the soft skills that sometimes more important that the technical skills that you have.&lt;/p&gt;  &lt;p&gt;Have you ever wondered-&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Do I sell my strong skills?&amp;#160; Or over sell my weak skills? &lt;/li&gt;    &lt;li&gt;Am I too focused on a specific technology?&amp;#160; Or not focused enough? &lt;/li&gt;    &lt;li&gt;Do I know where I want to be next year?&amp;#160; In 5 years?&amp;#160; In 10 years? &lt;/li&gt;    &lt;li&gt;Am I choosing my career or letting someone else hand it to me? &lt;/li&gt;    &lt;li&gt;Do I know the right people in my career? &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;All of these questions are important and if you don’t know who you are in your career, you can’t expect recruiters and the person across the table from you in your next interview to know who you are either.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Get An Education&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To aid in the all of this, Microsoft is currently hosting three webcasts (one of which already occurred but is available in their online library) that can help provide some great information and direction on building your career.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&amp;amp;EventID=1032420290&amp;amp;CountryCode=US"&gt;Thrive Live! (Part 1 of 3) Create a Personal Marketing Plan for Career Success&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032420291&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;Thrive Live! (Part 2 of 3) Be Lucky! How to Discover Your Next Job&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032420294&amp;amp;EventCategory=4&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;Thrive Live! (Part 3 of 3) From Dressing to Dollars: Gain Interview and Negotiating Power&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;These webcasts will help you to develop a personal brand around your career.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;But I Have A Job&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A good argument against checking out the resources at Thrive is that you may already have a job.&amp;#160; On the other hand &lt;a href="http://www.nytimes.com/2009/07/17/nyregion/17unemploy.html"&gt;nearly 10% of the country is currently unemployed&lt;/a&gt; and I bet a lot of them thought that as well.&amp;#160; Becoming a statistic in the unemployment line is probably too late to start thinking about making sure you are a critical resource and in charge of your career.&lt;/p&gt;  &lt;p&gt;Maybe you are completely safe in your career and there isn’t any reason at all to worry about losing your job and having to work with recruiters.&amp;#160; Then none of this is for you, right?&amp;#160; Dead wrong.&lt;/p&gt;  &lt;p&gt;Everyday is an opportunity to sell yourself to your employer and at least once every year you will have some sort of meeting where you re-interview for your position.&amp;#160; What?!&amp;#160; You don’t do this?&amp;#160; Or do you?!&lt;/p&gt;  &lt;p&gt;Every year you will get a chance to re-interview for your job.&amp;#160; Most people call this an annual review.&amp;#160; In this meeting, you talk about what you offer, what the company offers, and if things go well there is some discussion on compensation.&amp;#160; And to me this is an interview.&amp;#160; It’s just one where the chance of having the job is exceptionally high.&lt;/p&gt;  &lt;p&gt;So I’ve come across a little doom and gloom here, so I’ll wrap up with one last reason to check out Thrive.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;There is Free Stuff!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Not only can you improve your position in the market but there are also some offers for &lt;a href="http://www.microsoft.com/click/thrive/?view=html&amp;amp;p=TechOffers"&gt;free stuff on the Thrive site&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.globalknowledge.com/training/olm/go.asp?find=Msthrive_906_Course&amp;amp;country=United+States"&gt;Enter to win a Microsoft training course worth $2,995(US)&lt;/a&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Global Knowledge is a proud sponsor of the free training course giveaway on Microsoft's Thrive website. At the end of each month, we'll pick one lucky winner and giveaway one Microsoft Classroom or Virtual course valued at up to $2,995! That's right, the winner will get to choose the Microsoft course of their choice and get training FOR FREE!&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And who doesn’t love &lt;a href="http://www.bing.com/search?q=free+stuff&amp;amp;go=&amp;amp;form=QBLH"&gt;free stuff&lt;/a&gt;.&amp;#160; &lt;strike&gt;Yes, I managed to place a bing search in this.&lt;/strike&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Are you busy Wednesday, Thursday, and Friday?</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/20/are-you-busy-wednesday-thursday-and-friday.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-20:250eecee-dbe1-446f-acb5-f46dfa855d7a</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Conference" />
		<category term="SharePoint" />
		<updated>2009-07-20T16:00:00Z</updated>
		<published>2009-07-20T16:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/beach7_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="beach7" border="0" alt="beach7" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/beach7_thumb.jpg" width="192" height="134" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This week SSWUG is hosting another virtual conference featuring content for SQL, SharePoint, BI, and .NET professionals.&amp;#160; There is a lot going on and like their previous conferences you don’t have to leave the comforts of your beach bungalow to participate in the conference.&lt;/p&gt;  &lt;p&gt;I encourage everyone to &lt;a href="http://www.vconferenceonline.com/shows/summer09/uvc/"&gt;check this out&lt;/a&gt;…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;We're excited to present our 5th vConference series! Attend and find out why the world is raving about these great technical events! Networking with attendees, seeing demonstrations, getting how-to information, Q&amp;amp;A with speakers, downloadable samples and transcripts, on-demand content and much more.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Here’s some of the great content we’re putting together for you&lt;/em&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;em&gt;Scripting techniques for SQL Server &lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Powerful .NET development tips and tricks to help in your application development work &lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;SharePoint key points and techniques, things to optimize your installation &lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Troubleshooting and tuning techniques &lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Building reports, applying key Business Intelligence (BI) approaches to your work &lt;/em&gt;&lt;/li&gt;      &lt;li&gt;&lt;em&gt;Outstanding Sponsorship Opportunities - &lt;/em&gt;&lt;a href="http://www.vconferenceonline.com/sponsors.asp"&gt;&lt;em&gt;Be a sponsor!&lt;/em&gt;&lt;/a&gt;&lt;em&gt; Our sponsorship options are not what you're used to seeing - contact us today for exciting opportunities.&lt;/em&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;&lt;em&gt;Our surveys reveal that an incredible &lt;b&gt;88% of attendees&lt;/b&gt; gained knowledge they could use immediately, and &lt;b&gt;99% said they would probably be recommending a SSWUG.org Virtual Conference in the future&lt;/b&gt;.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To register for the event… &lt;a href="http://www.vconferenceonline.com/shows/summer09/uvc/"&gt;go here&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Analyzing Your Indexes with a Custom Report</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/20/analyzing-your-indexes-with-a-custom-report.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-20:3cc08863-2cd1-45e1-846a-2d6cd7bde85a</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="SQL 2008" />
		<updated>2009-07-20T13:00:00Z</updated>
		<published>2009-07-20T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/gv11_gallery__600x400_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="gv11_gallery__600x400" border="0" alt="gv11_gallery__600x400" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/gv11_gallery__600x400_thumb.jpg" width="244" height="164" /&gt;&lt;/a&gt; A while back I put together a number of posts around an index analysis query that I had put together to assist when I go out to clients.&amp;#160; If you are interested, the background for the query can be found in the following posts:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://stratesql.com/2009/04/19/analyze-this-ndash-your-indexes-analysis-ndash-part-1.aspx"&gt;Analyze Your Indexes Part 1&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://stratesql.com/2009/04/20/analyze-this-ndash-analyze-your-indexes-ndash-part-2.aspx"&gt;Analyze Your Indexes Part 2&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://stratesql.com/2009/04/21/analyze-this-ndash-analyze-your-indexes-ndash-part-3.aspx"&gt;Analyze Your Indexes Part 3&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://stratesql.com/2009/04/23/analyze-this-ndash-analyze-your-indexes-ndash-part-4.aspx"&gt;Analyze Your Indexes Part 4&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://stratesql.com/2009/04/28/analyze-this-ndash-analyze-your-indexes-ndash-part-5.aspx"&gt;Analyze Your Indexes Part 5&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://stratesql.com/2009/04/29/analyze-this-ndash-analyze-your-indexes-ndash-part-6.aspx"&gt;Analyze Your Indexes Part 6&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The query has proven to be quite useful for me… one problem with the query, though, was that the format wasn’t the most suitable for quick glance analysis.&amp;#160; It gave a lot of useful information but wasn’t in a format that made it easy to digest.&amp;#160; &lt;/p&gt;  &lt;p&gt;To solve this I’ve put together a report that can be executed from within SQL Server Management Studio.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/IndexAnalysisPic_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IndexAnalysisPic" border="0" alt="IndexAnalysisPic" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/IndexAnalysisPic_thumb.jpg" width="614" height="176" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you are interested in this report, there is now a &lt;a href="http://www.codeplex.com/"&gt;CodePlex&lt;/a&gt; project for the query and the custom report.&amp;#160; And it is aptly named &lt;a href="http://indexanalysis.codeplex.com/"&gt;IndexAnalysis&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Please comment and let me know if this is useful or if there are improvements that can help to improve it’s effectiveness.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Resource Governor Whitepaper</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/15/resource-governor-whitepaper.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-15:b3e14637-5bbc-46ae-99b5-5565e94a7aa9</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="Performance Tuning" />
		<category term="DBA" />
		<updated>2009-07-15T15:00:00Z</updated>
		<published>2009-07-15T15:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/mind_control_2.gif"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="mind_control" border="0" alt="mind_control" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/mind_control_thumb.gif" width="141" height="139" /&gt;&lt;/a&gt; There were some questions last night at the PASS MN user group meeting last night about the resource governor.&amp;#160; There must be some psychics working over at Microsoft because it seems just this morning a &lt;a href="http://msdn.microsoft.com/en-us/library/ee151608.aspx"&gt;whitepaper came out on it&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Some highlights from the whitepaper from the whitepaper include (from the download page):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;How the Resource Governor works, including limitations and best practices. &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Methods for building a consolidation plan, and testing those methods. &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Techniques for preventing runaway queries, or at least minimizing their impact. &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Approaches to meeting service level agreements (SLAs) driven by response time and concurrency. &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Basic ideas about implementing a chargeback system to recover resource costs. &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;Ways to monitor SQL Server using new Resource Governor functionality.&lt;/em&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Thanks to &lt;a href="http://twitter.com/AaronBertrand"&gt;Aaron Bertrand&lt;/a&gt; for &lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2009/07/14/resource-governor-whitepaper-is-now-available.aspx"&gt;mentioning the white paper&lt;/a&gt; this morning.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>July PASSMN Meeting Today (July 14)</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/14/july-passmn-meeting-today-july-14.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-14:5a4fce9d-57b0-422b-b2e0-75022e045d99</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<updated>2009-07-14T14:00:00Z</updated>
		<published>2009-07-14T14:00:00Z</published>
		<content type="html">&lt;p&gt;As I mentioned &lt;a href="http://stratesql.com/2009/07/06/july-passmn-meeting-next-week-july-15.aspx"&gt;last week&lt;/a&gt;, there is still time to get register and come down for PASS MN’s second annual &lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1577"&gt;Ask the Experts Panel&lt;/a&gt; discussion.&amp;#160; The panel will be available to answer questions and help move the conversation along for all attendees.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Volunteering and Resume Building</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/13/volunteering-and-resume-building.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-13:6ad34ff9-db5f-4530-b271-e010f4bc30bc</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="Tools and Tips" />
		<updated>2009-07-13T20:55:05Z</updated>
		<published>2009-07-13T20:55:05Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/idea_bulb_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="idea_bulb" border="0" alt="idea_bulb" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/idea_bulb_thumb.jpg" width="147" height="111" /&gt;&lt;/a&gt; I really like a great idea.&amp;#160; They have this way of going from a great idea to success.&amp;#160; When you hear a great idea it is always a good idea to share the idea – and let it spread like a virus.&lt;/p&gt;  &lt;p&gt;Today, while I was going through and reading posts from Microsoft’s SQL Server bloggers, I found one of these great ideas.&amp;#160; &lt;a href="http://blogs.msdn.com/buckwoody/archive/2009/07/13/getting-a-job-the-catch-22.aspx"&gt;Buck Woody talked about&amp;#160; combining a little volunteerism with resume building&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In a tight economy non-profits have to make tough decisions between their staffing and infrastructure versus the services that are provided.&amp;#160; By volunteering, we can help with those decisions by filling the void of one where the donations are no longer coming in.&amp;#160; And as is mentioned in Buck’s post, at the same time was can work on building our own resume.&amp;#160; I hope I don’t have to explain the benefit of a good resume.&lt;/p&gt;  &lt;p&gt;To help inspire others to volunteer and build their resume, I found a few places in Minnesota where people can do some technical volunteering.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.handsontwincities.org/"&gt;Hands On Twin Cities&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.idealist.org"&gt;Idealist&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.volunteermatch.org"&gt;Volunteer Match&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.mnheadhunter.com/vol/"&gt;MN Headhunter&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I found a few database related opportunities when I looked through these sites.&amp;#160; And encourage anyone looking to build their resume and do some volunteering to check them out.&lt;/p&gt;  &lt;p&gt;If anyone knows any other resources or has a story to share along this topic, feel free to comment or e-mail me about it at &lt;a href="mailto:jstrate@digineer.com"&gt;jstrate@digineer.com&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>July PASSMN Meeting This Week (July 14)</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/06/july-passmn-meeting-next-week-july-14.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-13:bc36fc79-1598-4753-9277-bbd28768c7a6</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SQL 2008" />
		<category term="SQLServer" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<updated>2009-07-13T14:00:00Z</updated>
		<published>2009-07-13T14:00:00Z</published>
		<content type="html">&lt;p&gt;There is still time to get registered…&lt;/p&gt;  &lt;p&gt;So if you’ve got questions about about indexes and other SQL Server related topics bring them down.&amp;#160; We are having the second annual &lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1577"&gt;Ask the Experts Panel&lt;/a&gt; discussion:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;Speakers:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;       &lt;p&gt;&lt;em&gt;Lara Rubbelke, Microsoft&lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;      &lt;li&gt;       &lt;p&gt;&lt;em&gt;Sanjay Kaul, Microsoft&lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;      &lt;li&gt;       &lt;p&gt;&lt;em&gt;Dan English, Magenic&lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;      &lt;li&gt;       &lt;p&gt;&lt;em&gt;Jason Strate, Digineer &lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;&lt;em&gt;After the popularity of last year's &amp;quot;Ask the Expert's&amp;quot;, we decided to bring back the forum this year.&amp;#160; PASS members will have the opportunity to pose any burning questions they might have about SQL Server to our expert panel.&amp;#160; We will round things out with a couple tips or tricks about SQL Server from each of our panel experts.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;The Panel&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Lara Rubbelke&lt;/strong&gt; brings her passion for architecting, implementing and improving SQL Server solutions to the community as a Technology Specialist for Microsoft. Her expertise involves both OLTP and OLAP systems, data management, performance tuning, encryption, ETL, and the Business Intelligence lifecycle. She is an active board member of the local PASS (Professional Association for SQL Server) chapter and regularly delivers technical presentations at local, regional and national conferences, user groups and webcasts. Lara authored the Microsoft whitepaper detailing SQL Server 2005 Enterprise Edition features and was a contributing author of &amp;quot;Expert SQL Server 2005 Development&amp;quot;. Prior to joining Microsoft, Lara was a Microsoft Most Valuable Professional (MVP). &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Sanjay Kaul&lt;/strong&gt; is a database professional with over 15 years of experience in various database technologies. In his current position as a SQL Server Technology Specialist, he spends his day as an ambassador for Microsoft - promoting, evangelizing, and assisting customer realize their potential using SQL Server Technologies, and evenings furthering his culinary skills. &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Dan English&lt;/strong&gt; - Dan is a Principal Consultant with Magenic and has been developing with Microsoft technologies for over 12 years and has over 5 years experience with Data Warehousing and Business Intelligence. He has been working with SQL Server since version 6.5 and now with 2008 looking towards the Kilimanjaro release. Dan has screencasts of SQL Server 2008 and PerformancePoint Server on YouTube and Soapbox ( keyword search - Magenic) and is an avid blogger (&lt;/em&gt;&lt;a href="http://denglishbi.spaces.live.com"&gt;&lt;em&gt;http://denglishbi.spaces.live.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;). Dan is fully certified with MS SQL Server 2005 and 2008 Business Intelligence. He enjoys keeping in contact with the community at large responding to forum postings on the Microsoft forums and SQL Server Central areas. Dan is also part of the PASSMN 2009 Executive Board.&amp;#160; &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Jason Strate&lt;/strong&gt;, Digineer Inc, has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft’s published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition&amp;quot; and actively blogs about SQL Server and related technologies. Also this year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008, presented at the SSWUG SQL Server Launch Event and is presenting in upcoming SSWUG SQL Server Conference. &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>5 Common Mistakes with Tempdb</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/08/5-common-mistakes-with-tempdb.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-08:8e9ed4c7-ae5c-4b51-b106-8d84c6bb05e9</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DBA" />
		<updated>2009-07-08T17:00:00Z</updated>
		<published>2009-07-08T17:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/ouch_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="ouch" border="0" alt="ouch" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/ouch_thumb.jpg" width="244" height="176" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One of the things I get to do pretty often is to visit with clients and discuss how they’ve implemented their SQL Server environment.&amp;#160; And if the title of this post is any indication of the contents there are a number of issues that I tend to be able to make recommendations on in all of these environments.&lt;/p&gt;  &lt;p&gt;Below are five of the most common tempdb items that I come across:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Just a single tempdb data file: &lt;/strong&gt;As a rule of thumb, Tempdb should have as many data files as there are CPUs/cores for the SQL Server instance.&amp;#160; This prevents helps contention that can occur during peak tempdb activity.&amp;#160; Of course, too many files can be a problem as well so if you are thinking of adding more than 8 data files, look at doing some testing to verify the additional files are not causing performance issues of their own.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Multiple tempdb transaction logs: &lt;/strong&gt;The transaction log, of course, serves a much different purpose than the data files.&amp;#160; It’s there to log all of the transactions from tempdb and performs this function sequentially.&amp;#160; No matter how many files you have only one will be active at any time.&amp;#160; Having extra files won’t necessarily change performance or how tempdb behaves but it’s not going to provide any benefit.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Size Doesn’t Matter:&lt;/strong&gt; The data files for tempdb should all be the same size and large enough to handle the workload for all 24 hours of the day.&amp;#160; If one of the files grows for some reason, the other files should be grown as well to keep all of the files the same size.&amp;#160; This helps SQL Server distribute the work &lt;strike&gt;more better&lt;/strike&gt; evenly across the tempdb data files.&amp;#160; Also, there are a number of operations that utilize tempdb – make sure you have the room.&amp;#160; Skipping DBCC CHECKS because tempdb is too small is a recipe for disaster a la mode.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Tempdb and user database data files sharing a disk:&lt;/strong&gt; Tempdb should be separated and isolated from user databases.&amp;#160; This creates contention between the user databases and tempdb.&amp;#160; Contention with temporary objects when executing a query and reading data from a user data typically has one unfortunate result… poor performance.&amp;#160; And no one likes that…&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Tempdb on the slowest disk:&lt;/strong&gt; Ugh!&amp;#160; Just because the databases on the server aren’t creating temporary tables doesn’t mean tempdb isn’t being used.&amp;#160; Queries that use operations such as Sort, Hash Match, and Spool will use tempdb and the faster the disk for tempdb the faster the performance of the query.&amp;#160; Tempdb has a lot of activity from all of the databases on the server and if it can’t push it’s IO quickly nearly everything will suffer.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I’ve kept these items fairly short and without a lot of detail because if you are doing any of these you need to read up on &lt;a href="http://technet.microsoft.com/en-us/library/ms175527.aspx"&gt;tempdb performance in Books Online&lt;/a&gt; and read the whitepaper &lt;a href="http://technet.microsoft.com/en-us/library/cc966545.aspx"&gt;Working with Tempdb&lt;/a&gt;.&amp;#160; Tempdb is a crucial resource in the SQL Server environment and it’s configuration should be a first thought rather than an after thought to prevent from having it &lt;a href="http://wiki.answers.com/Q/How_do_you_cure_a_snake_bite"&gt;bite you in the face&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Taking care of these kinds of easy configuration issues will help make certain that your tempdb is &lt;a href="http://www.youtube.com/watch?v=DgBgnoEY4iM"&gt;Harder, Better, Faster, Stronger&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Script Data for a Table</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/07/script-data-for-a-table.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-07:22a24f0f-b33d-4d2c-8264-4d06af81ffe0</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<updated>2009-07-07T23:00:00Z</updated>
		<published>2009-07-07T23:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B3%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 0px 10px 5px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[3]" border="0" alt="CropperCapture[3]" align="left" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B3%5D_thumb.jpg" width="211" height="93" /&gt;&lt;/a&gt;Today a &lt;a href="http://twitter.com/cliff_77/statuses/2521180719"&gt;tweet&lt;/a&gt; came across my screen that mentioned that you can’t script out data from SQL Server tables.&lt;/p&gt;  &lt;p&gt;But… actual you can if you have SQL Server Management Studio 2008 installed.&amp;#160; It’s one of the new options under the task Generate Scripts.&amp;#160; And it works very well and is easy to do.&lt;/p&gt;  &lt;p&gt;To demonstrate, I’ll walk through the steps to create scripts for all of the data in the table HumanResource.Department in the AdventureWorks database.&lt;/p&gt;  &lt;p&gt;First, select the Tasks—&amp;gt; Generate Scripts… option from the right-click menu under databases:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B6%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[6]" border="0" alt="CropperCapture[6]" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B6%5D_thumb.jpg" width="404" height="475" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Next select the database that you need to script data from.&amp;#160; In this case I selected the AdventureWorks database and then selected Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B7%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[7]" border="0" alt="CropperCapture[7]" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B7%5D_thumb.jpg" width="404" height="367" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;For this example, I only want to return the data from the table.&amp;#160; The options (show below) should be set to FALSE:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Script Create &lt;/li&gt;    &lt;li&gt;Script Defaults &lt;/li&gt;    &lt;li&gt;Script Extended Properties &lt;/li&gt;    &lt;li&gt;Script Check Constraints &lt;/li&gt;    &lt;li&gt;Script Foreign Keys &lt;/li&gt;    &lt;li&gt;Script Primary Keys &lt;/li&gt;    &lt;li&gt;Script Unique Keys &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Also, the option for Script Data should be changed to TRUE.&amp;#160; This is also show below.&amp;#160; Then select Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B9%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[9]" border="0" alt="CropperCapture[9]" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B9%5D_thumb.jpg" width="404" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B11%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[11]" border="0" alt="CropperCapture[11]" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B11%5D_thumb.jpg" width="404" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now that the work has been determined, it is time to pick the objects to generate scripts on.&amp;#160; In this example, I am only selecting tables since I only want the data.&amp;#160; Then select Next.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/NextOptions1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="NextOptions1" border="0" alt="NextOptions1" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/NextOptions1_thumb.jpg" width="404" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select the table to get the data from and select Next again.&amp;#160; &lt;strike&gt;I think the hardest thing in the little tutorial is all these Next buttons.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/NextOptions2_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="NextOptions2" border="0" alt="NextOptions2" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/NextOptions2_thumb.jpg" width="404" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now you are ready to get the data from the table.&amp;#160; You can put it into any of the containers that are typically available.&amp;#160; I left the default of New Query Window.&amp;#160; After this decision, you guessed it… select Next again.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B14%5D_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[14]" border="0" alt="CropperCapture[14]" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/CropperCapture%5B14%5D_thumb.jpg" width="404" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The script will generate all of your INSERT statements (as shown in the window below).&amp;#160; It also includes the IDENTITY_INSERT as needed.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [AdventureWorks]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;
/****** &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;:  &lt;span style="color: #0000ff"&gt;Table&lt;/span&gt; [HumanResources].[Department]    Script &lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;: 07/07/2009 17:15:08 ******/
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY_INSERT&lt;/span&gt; [HumanResources].[Department] &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (1, N&lt;span style="color: #006080"&gt;'Engineering'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Research and Development'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (2, N&lt;span style="color: #006080"&gt;'Tool Design'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Research and Development'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (3, N&lt;span style="color: #006080"&gt;'Sales'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Sales and Marketing'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (4, N&lt;span style="color: #006080"&gt;'Marketing'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Sales and Marketing'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (5, N&lt;span style="color: #006080"&gt;'Purchasing'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Inventory Management'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (6, N&lt;span style="color: #006080"&gt;'Research and Development'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Research and Development'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (7, N&lt;span style="color: #006080"&gt;'Production'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Manufacturing'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (8, N&lt;span style="color: #006080"&gt;'Production Control'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Manufacturing'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (9, N&lt;span style="color: #006080"&gt;'Human Resources'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Executive General and Administration'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (10, N&lt;span style="color: #006080"&gt;'Finance'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Executive General and Administration'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (11, N&lt;span style="color: #006080"&gt;'Information Services'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Executive General and Administration'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (12, N&lt;span style="color: #006080"&gt;'Document Control'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Quality Assurance'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (13, N&lt;span style="color: #006080"&gt;'Quality Assurance'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Quality Assurance'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (14, N&lt;span style="color: #006080"&gt;'Facilities and Maintenance'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Executive General and Administration'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (15, N&lt;span style="color: #006080"&gt;'Shipping and Receiving'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Inventory Management'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
INSERT [HumanResources].[Department] ([DepartmentID], [Name], [GroupName], [ModifiedDate]) &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (16, N&lt;span style="color: #006080"&gt;'Executive'&lt;/span&gt;, N&lt;span style="color: #006080"&gt;'Executive General and Administration'&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(0x00008C6900000000 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DateTime))
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY_INSERT&lt;/span&gt; [HumanResources].[Department] &lt;span style="color: #0000ff"&gt;OFF&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I’ve used this a couple times for generating deploy scripts and it’s worked very well.&amp;#160; A very nice addition to SQL Server Management Studio 2008.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>What Happened to My Fabulous Beverage!</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/07/what-happened-to-my-fabulous-beverage.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-07:49cfbffa-43b9-4239-875d-89652ea63422</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="DBA" />
		<updated>2009-07-07T21:30:00Z</updated>
		<published>2009-07-07T21:30:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/large_empty-pint-glass_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px; display: inline; border-top: 0px; border-right: 0px" title="large_empty-pint-glass" border="0" alt="large_empty-pint-glass" align="left" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/large_empty-pint-glass_thumb.jpg" width="152" height="115" /&gt;&lt;/a&gt; Everyone likes taking some time to relax.&amp;#160; You’re sitting out in the sunshine or on a beach and the waitress is bringing you your favorite beverage.&amp;#160; The company and conversation is great and it seems like the perfect day.&amp;#160; And then… suddenly without warning… your drink is gone.&lt;/p&gt;  &lt;p&gt;You were having a great time and the waiter, who should be monitoring for this situation, failed to do so.&amp;#160; As the conversation is interrupted by this horror of this situation you look around the table and start sipping on what’s left of the water you had with dinner.&lt;/p&gt;  &lt;p&gt;What if there wasn’t water to switch to?&amp;#160; What would have happened?&lt;/p&gt;  &lt;p&gt;In much the same way, DBAs are the waiters and waitresses for their SQL Servers.&amp;#160; Instead of serving beverages, we provide space to the database files for our environments.&amp;#160; In most cases the conversations (transactions) in the database will be safe from harm because there will be extra water (space) laying around.&lt;/p&gt;  &lt;p&gt;What if there isn’t and you haven’t planned ahead for this scenario?&amp;#160; It would be worse to have you actual drinks and evening with friends interrupted because the SQL Servers are offline because they ran out of the space necessary to grow.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;I’m Growing and Taking More Beverages With Me&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In a previous post I talked about knowing when a &lt;a href="http://stratesql.com/2009/06/30/when-did-that-file-get-so-big.aspx"&gt;file growth has occurred&lt;/a&gt;.&amp;#160; This is the after-the-fact alert to inform that things may not be going as planned.&amp;#160; Before you get to that point,&amp;#160; it would be nice to have something in place that informs that unplanned growth may occur.&lt;/p&gt;  &lt;p&gt;To that end…&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How Many Kegs Are Left In the Cooler?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;To help alleviate evening interruptions, I put together a file space monitoring alert for the&amp;#160; &lt;a href="http://stratesql.com/2009/05/29/dbadiagnostics-ndash-my-dba-database.aspx"&gt;DBADiagnostics&lt;/a&gt; database a while back.&amp;#160; This alert is usually scheduled through a SQL Server Agent job and is executed in the morning before the day starts.&amp;#160; This allows me to see which databases may need some action through the day and I get all day minus meetings, emergencies, meetings, and other work to get this taken care of.&lt;/p&gt;  &lt;p&gt;To cut to the chase, here is the procedure:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Alert'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt;(&lt;span style="color: #006080"&gt;'CREATE SCHEMA [Alert] AUTHORIZATION [dbo]'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'Alert.FilegroupSpaceAvailable'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[FilegroupSpaceAvailable]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

/*================================================================================
&lt;span style="color: #0000ff"&gt;Procedure&lt;/span&gt;:    Alert.FilegroupSpaceAvailable
Author:        Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        2005-04-05

Synopsis:
    Alert &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; monitor amount &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; available &lt;span style="color: #0000ff"&gt;space&lt;/span&gt; within &lt;span style="color: #0000ff"&gt;database&lt;/span&gt; datafiles. 

    This process does &lt;span style="color: #0000ff"&gt;not&lt;/span&gt; take &lt;span style="color: #0000ff"&gt;into&lt;/span&gt; account &lt;span style="color: #0000ff"&gt;space&lt;/span&gt; &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; &lt;span style="color: #0000ff"&gt;transaction&lt;/span&gt; logs. &lt;span style="color: #0000ff"&gt;Database&lt;/span&gt; 
    recovery strategy should account &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; those files.

&lt;span style="color: #0000ff"&gt;Parameters&lt;/span&gt;:
    @PercentFull: Threshold percenteage &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;space&lt;/span&gt; used &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;span style="color: #0000ff"&gt;data&lt;/span&gt; &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;
    @MBEmpty: Threshold MB &lt;span style="color: #0000ff"&gt;value&lt;/span&gt; &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;space&lt;/span&gt; remaining &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;span style="color: #0000ff"&gt;each&lt;/span&gt; &lt;span style="color: #0000ff"&gt;data&lt;/span&gt; &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;.  Prevents
        &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;-positive alerts &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;large&lt;/span&gt; databases
    @ToAddress: E-mail address &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; send the alert
    @SubjectWarning: &lt;span style="color: #0000ff"&gt;Prefix&lt;/span&gt; &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; e-mail message &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; code &lt;span style="color: #0000ff"&gt;or&lt;/span&gt; rate the alert

================================================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;            Description
--------------------------------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
================================================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[FilegroupSpaceAvailable]
    (
    @PercentFull &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(5,2) = 90,
    @MBEmpty &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; = 2500,
    @ToAddress &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255),
    @SubjectWarning &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255) = &lt;span style="color: #006080"&gt;''&lt;/span&gt;
    )
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; NOCOUNT &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;

--&lt;span style="color: #0000ff"&gt;Declare&lt;/span&gt; variables &lt;span style="color: #0000ff"&gt;section&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @db_full_pages &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;,
    @db_full_percentage &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;,
    @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; nvarchar(4000),
    @db_size &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; @PercentFull &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BETWEEN&lt;/span&gt; 1 &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; 99 &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @PercentFull &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
   &lt;span style="color: #0000ff"&gt;RAISERROR&lt;/span&gt;(&lt;span style="color: #006080"&gt;'@PercentFull must be a value between 1 and 99.'&lt;/span&gt;, 16, 1)
   &lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt; -1
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt; 

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; @MBEmpty &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
   &lt;span style="color: #0000ff"&gt;RAISERROR&lt;/span&gt;(&lt;span style="color: #006080"&gt;'@MBEmpty can not be null.'&lt;/span&gt;, 16, 1)
   &lt;span style="color: #0000ff"&gt;RETURN&lt;/span&gt; -1
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt; 

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'tempdb..#FileStats'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #FileStats

&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #FileStats
    (
    FileID &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;,
    FileGroup &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;,
    TotalExtents bigint,
    UsedExtents bigint,
    Name &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255),
    [FileName] &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255)
    )

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'tempdb..#Output'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #&lt;span style="color: #0000ff"&gt;Output&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; #&lt;span style="color: #0000ff"&gt;Output&lt;/span&gt;
    (
    DatabaseName sysname,
    ID &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY&lt;/span&gt;(1,1),
    FileGroup &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255),
    FileName &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255),
    FilePath &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255),
    SpaceAvailable &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;,
    SpaceUsed &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;,
    PercentUsed &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,6)
    )

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @DBName nvarchar(128)

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; CURS_DATABASE &lt;span style="color: #0000ff"&gt;CURSOR&lt;/span&gt; &lt;span style="color: #0000ff"&gt;LOCAL&lt;/span&gt; FAST_FORWARD &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; name &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.databases
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; source_database_id &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; state_desc = &lt;span style="color: #006080"&gt;'ONLINE'&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_read_only = 0
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_in_standby = 0
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; name &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #006080"&gt;'model'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'master'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'msdb'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;OPEN&lt;/span&gt; CURS_DATABASE

&lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;From&lt;/span&gt; CURS_DATABASE &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @DBName

&lt;span style="color: #0000ff"&gt;WHILE&lt;/span&gt; &lt;span style="color: #cc6633"&gt;@@Fetch_Status&lt;/span&gt; = 0
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; = &lt;span style="color: #006080"&gt;'Use ['&lt;/span&gt; + @DBName + &lt;span style="color: #006080"&gt;'];
        Exec('&lt;/span&gt;&lt;span style="color: #006080"&gt;'DBCC showfilestats'&lt;/span&gt;&lt;span style="color: #006080"&gt;')'&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;DELETE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #FileStats

    INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; #FileStats
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; sp_ExecuteSQL @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; = &lt;span style="color: #006080"&gt;'Use ['&lt;/span&gt; + @DBName + &lt;span style="color: #006080"&gt;'];
        SELECT '&lt;/span&gt;&lt;span style="color: #006080"&gt;''&lt;/span&gt; + @DBName + &lt;span style="color: #006080"&gt;''&lt;/span&gt;&lt;span style="color: #006080"&gt;'
            ,RTRIM(fg.name)
            ,RTRIM(f.name)
            ,RTRIM(f.physical_name)
            ,(TotalExtents * 64) / 1024.
            ,(UsedExtents * 64) / 1024.
            ,100 * CAST(((UsedExtents * 64) / 1024.)/((TotalExtents * 64) / 1024.) as decimal(12,6))
        FROM #FileStats fs
            INNER JOIN sys.database_files f On fs.Name = f.Name COLLATE SQL_Latin1_General_CP1_CI_AS
            INNER JOIN sys.filegroups fg On    f.data_space_id = fg.data_space_id 
        WHERE CAST(((UsedExtents * 64) / 1024.)/((TotalExtents * 64) / 1024.) as decimal(12,6)) &amp;gt; '&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;Convert&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;, @PercentFull/100) + &lt;span style="color: #006080"&gt;'
        AND ((TotalExtents * 64)) / 1024. - ((UsedExtents * 64) / 1024.) &amp;lt;=  '&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;Convert&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;, @MBEmpty) + &lt;span style="color: #006080"&gt;'
        ORDER BY fg.name, f.name'&lt;/span&gt;

    INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; #&lt;span style="color: #0000ff"&gt;Output&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; sp_ExecuteSQL @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;From&lt;/span&gt; CURS_DATABASE &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @DBNAME
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;CLOSE&lt;/span&gt; CURS_DATABASE
&lt;span style="color: #0000ff"&gt;DEALLOCATE&lt;/span&gt; CURS_DATABASE

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #&lt;span style="color: #0000ff"&gt;Output&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; NOTIFICATION_CURS &lt;span style="color: #0000ff"&gt;CURSOR&lt;/span&gt; &lt;span style="color: #0000ff"&gt;LOCAL&lt;/span&gt; FAST_FORWARD &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; DatabaseName,
            FileGroup,
            FileName,
            FilePath,
            SpaceAvailable,
            SpaceUsed,
            PercentUsed
        &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; #&lt;span style="color: #0000ff"&gt;Output&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @DatabaseName nvarchar(255),
        @FileGroup nvarchar(255),
        @FileName nvarchar(255),
        @FilePath nvarchar(255),
        @SpaceAvailable nvarchar(255),
        @SpaceUsed nvarchar(255),
        @PercentUsed nvarchar(255),
        @Subject nvarchar(255),
        @Body nvarchar(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)

    &lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; @Subject = LTRIM(@SubjectWarning + &lt;span style="color: #0000ff"&gt;SPACE&lt;/span&gt;(1) + @@SERVERNAME) + &lt;span style="color: #006080"&gt;': FileGroup Space Available Notification'&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; @Body = &lt;span style="color: #006080"&gt;'The following database files belong to filegroups that nearly full.  Please increase the size of the files to prevent unscheduled file growth.&amp;lt;p&amp;gt;'&lt;/span&gt; +
            &lt;span style="color: #006080"&gt;'&amp;lt;table border=1 cellspacing=0 cellpadding=0 align=center&amp;gt;'&lt;/span&gt; + 
            &lt;span style="color: #006080"&gt;'&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Database Name&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;File Group&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;File Name&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;File Path&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Space Available&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Space USed&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Percent Used&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;'&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;OPEN&lt;/span&gt; NOTIFICATION_CURS
    &lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; NOTIFICATION_CURS &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @DatabaseName, @FileGroup, @FileName, @FilePath, @SpaceAvailable, @SpaceUsed, @PercentUsed

    &lt;span style="color: #0000ff"&gt;While&lt;/span&gt; &lt;span style="color: #cc6633"&gt;@@Fetch_Status&lt;/span&gt; = 0
    &lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; @Body = @Body + &lt;span style="color: #006080"&gt;'&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @DatabaseName + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @FileGroup + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @FileName + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @FilePath 
            + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @SpaceAvailable + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @SpaceUsed + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;'&lt;/span&gt; + @PercentUsed + &lt;span style="color: #006080"&gt;'&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;'&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; NOTIFICATION_CURS &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @DatabaseName, @FileGroup, @FileName, @FilePath, @SpaceAvailable, @SpaceUsed, @PercentUsed
    &lt;span style="color: #0000ff"&gt;END&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;CLOSE&lt;/span&gt; NOTIFICATION_CURS
    &lt;span style="color: #0000ff"&gt;DEALLOCATE&lt;/span&gt; NOTIFICATION_CURS

    &lt;span style="color: #0000ff"&gt;Exec&lt;/span&gt; msdb.dbo.sp_send_dbmail 
        @recipients = @ToAddress,
        @subject = @Subject,
        @body = @Body,
        @body_format =  &lt;span style="color: #006080"&gt;'HTML'&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;
GO&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The parameters for the procedure are as follows:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;@PercentFull: &lt;/strong&gt;Threshold percenteage for space used in data file&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;@MBEmpty: &lt;/strong&gt;Threshold MB value for space remaining in each data file.&amp;#160; Prevents false-positive alerts for large databases&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;@ToAddress: &lt;/strong&gt;E-mail address to send the alert&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;@SubjectWarning: &lt;/strong&gt;Prefix to e-mail message to code or rate the alert&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Getting It Taken Care Of&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This alert should not be used an a replacement to planning for the future growth of your databases.&amp;#160; Instead, the current and historical database sizes should be used to accommodate for future growth and should be reviewed at regular intervals.&lt;/p&gt;

&lt;p&gt;Notifications of this sort are designed to let you know that unplanned growth may be possible and the historical growth rates ay no longer be valid based on the receipt of the alert.&amp;#160; Always know where you expect the database size to be and use this notification to determine when pre-determined safety threshold have been exceeded.&lt;/p&gt;

&lt;p&gt;Nobody wants to run out of space or beer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Caution:&amp;#160; &lt;/strong&gt;The procedure uses the undocumented command DBCC SHOWFILESTATS.&amp;#160; Use this in production with caution.&amp;#160; It is the same process that SQL Server Management Studio uses to get this information.&amp;#160; But the command can change at any time without notice.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>July PASSMN Meeting Next Week (July 14)</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/06/july-passmn-meeting-next-week-july-15.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-06:3d1ce2b0-4051-4448-a6d7-c182c9708f0e</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="MNSSUG" />
		<category term="PASS" />
		<updated>2009-07-06T16:00:00Z</updated>
		<published>2009-07-06T16:00:00Z</published>
		<content type="html">&lt;p&gt;Got that question about string theory that you just can’t seem to get answered?&amp;#160; Well, I don’t think the next PASSMN meeting will have your answer, but I bet it can answer some of your questions about indexes and other SQL Server related topics.&lt;/p&gt;  &lt;p&gt;We are having the second annual &lt;a href="http://www.digitalconcourse.com/getdigi/DC4Main.asp?p=210&amp;amp;ConfCode=1577"&gt;Ask the Experts Panel&lt;/a&gt; discussion:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;Speakers:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;       &lt;p&gt;&lt;em&gt;Lara Rubbelke, Microsoft&lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;      &lt;li&gt;       &lt;p&gt;&lt;em&gt;Sanjay Kaul, Microsoft&lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;      &lt;li&gt;       &lt;p&gt;&lt;em&gt;Dan English, Magenic&lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;      &lt;li&gt;       &lt;p&gt;&lt;em&gt;Jason Strate, Digineer &lt;/em&gt;&lt;/p&gt;     &lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;&lt;em&gt;After the popularity of last year's &amp;quot;Ask the Expert's&amp;quot;, we decided to bring back the forum this year.&amp;#160; PASS members will have the opportunity to pose any burning questions they might have about SQL Server to our expert panel.&amp;#160; We will round things out with a couple tips or tricks about SQL Server from each of our panel experts.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;The Panel&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Lara Rubbelke&lt;/strong&gt; brings her passion for architecting, implementing and improving SQL Server solutions to the community as a Technology Specialist for Microsoft. Her expertise involves both OLTP and OLAP systems, data management, performance tuning, encryption, ETL, and the Business Intelligence lifecycle. She is an active board member of the local PASS (Professional Association for SQL Server) chapter and regularly delivers technical presentations at local, regional and national conferences, user groups and webcasts. Lara authored the Microsoft whitepaper detailing SQL Server 2005 Enterprise Edition features and was a contributing author of &amp;quot;Expert SQL Server 2005 Development&amp;quot;. Prior to joining Microsoft, Lara was a Microsoft Most Valuable Professional (MVP). &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Sanjay Kaul&lt;/strong&gt; is a database professional with over 15 years of experience in various database technologies. In his current position as a SQL Server Technology Specialist, he spends his day as an ambassador for Microsoft - promoting, evangelizing, and assisting customer realize their potential using SQL Server Technologies, and evenings furthering his culinary skills. &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Dan English&lt;/strong&gt; - Dan is a Principal Consultant with Magenic and has been developing with Microsoft technologies for over 12 years and has over 5 years experience with Data Warehousing and Business Intelligence. He has been working with SQL Server since version 6.5 and now with 2008 looking towards the Kilimanjaro release. Dan has screencasts of SQL Server 2008 and PerformancePoint Server on YouTube and Soapbox ( keyword search - Magenic) and is an avid blogger (&lt;/em&gt;&lt;a href="http://denglishbi.spaces.live.com"&gt;&lt;em&gt;http://denglishbi.spaces.live.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;). Dan is fully certified with MS SQL Server 2005 and 2008 Business Intelligence. He enjoys keeping in contact with the community at large responding to forum postings on the Microsoft forums and SQL Server Central areas. Dan is also part of the PASSMN 2009 Executive Board.&amp;#160; &lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;strong&gt;Jason Strate&lt;/strong&gt;, Digineer Inc, has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft’s published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition&amp;quot; and actively blogs about SQL Server and related technologies. Also this year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008, presented at the SSWUG SQL Server Launch Event and is presenting in upcoming SSWUG SQL Server Conference. &lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Microsoft MVP 2009 for SQL Server</title>
		<link rel="alternate" href="http://stratesql.com/2009/07/01/microsoft-mvp-2009-for-sql-server.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-07-01:adea15fa-d543-4e15-a17c-359ec579c52c</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<updated>2009-07-01T17:00:00Z</updated>
		<published>2009-07-01T17:00:00Z</published>
		<content type="html">&lt;p&gt;I received an e-mail from Microsoft today presenting me with the 2009 &lt;a href="https://mvp.support.microsoft.com/Default.aspx"&gt;Microsoft MVP&lt;/a&gt; Award for the work I’ve done with SQL Server.&amp;#160; I thrilled beyond believe to have this honor.&amp;#160; I think this means I should buy myself a new jet ski… is three of them really enough?&lt;/p&gt;  &lt;p&gt;Thanks to everyone that has helped me as I’ve played with SQL Server over the years.&amp;#160; From my start at US Bank to my current role at Digineer there are so many people to mention that I’m afraid I’ll miss someone if I start listing people individually.&amp;#160; &lt;/p&gt;  &lt;p&gt;Also… my ability to focus on anything today is gone. &lt;/p&gt;</content>
	</entry>
	<entry>
		<title>When Did That File Get So Big?</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/30/when-did-that-file-get-so-big.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-30:30fecc65-b9b5-4851-a2df-d09e13a7c775</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL 2005" />
		<category term="DBA" />
		<updated>2009-06-30T22:00:00Z</updated>
		<published>2009-06-30T22:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/omg1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="omg1" border="0" alt="omg1" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/omg1_thumb.jpg" width="141" height="120" /&gt;&lt;/a&gt; I haven’t blogged much since getting back from vacation.&amp;#160; It seems like a good restart after the two week hiatus would be to address an issue that has arisen countless times.&amp;#160; And while addressing it, I’ll put it into the &lt;a href="http://stratesql.com/2009/05/29/dbadiagnostics-ndash-my-dba-database.aspx"&gt;DBADiagnostics&lt;/a&gt; database that I’ve blogged about a few times before.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Sudden File Growth&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In a number of SQL Server environments that I’ve worked in there either isn’t a method for monitoring file size or the process is more of a rubber stamp morning check.&amp;#160; The DBA gets in and looks at the size of the files and if there isn’t a log of changes to update nothing is really done and changes aren’t investigated.&lt;/p&gt;  &lt;p&gt;In most cases this won’t be a problem.&amp;#160; For instance, if you’ve gone out and pre-grown your data and log files to appropriate sizes then nothing will grow and there is nothing to see here.&lt;/p&gt;  &lt;p&gt;In cases were the unexpected happens, though, database files can and will grow.&amp;#160; And in the worst of these cases, which only occur at night or on vacations, the files will grow to a point where there is no longer any disk space available.&amp;#160; And if your annual review is next week, this will happen to the log file and force your database offline.&lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;strong&gt;Knowing Is Half the Battle&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;In these types of situations, I like to recall the last couple minutes of the GI Joe epos ides that I watched as a kid.&amp;#160; They almost always ended with the quote, “Knowing is half the battle!&amp;#160; Yo, Joe!”.&amp;#160; If I know that a file growth has happened then I can do something about it.&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;Now the best case is to know, monitor, and plan for upcoming file growths.&amp;#160; This is what might be called a &lt;em&gt;best practice&lt;/em&gt; and if you’re not doing it I’d really recommend putting a process in place.&amp;#160; But we need to be prepared for the unexpected.&amp;#160; And even in the most best, rock solid environment, I’d recommend a file growth monitoring process.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This procedure for the DBADiagnostics database differs slightly from previous alerts.&amp;#160; Instead of sending out an e-mail that aggregates all of the changes an error is raised for each file change in question.&amp;#160; This method was selected because this allows the process to be tool agnostic.&lt;/p&gt;  &lt;p&gt;If the client has a log file monitoring process, then the error can be picked up that way.&amp;#160; Or if all of the alerts are generated from the SQL Server instances, then a SQL Agent Alert can be created to notify people about the issue.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Monitor'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt;(&lt;span style="color: #006080"&gt;'CREATE SCHEMA [Monitor] AUTHORIZATION [dbo]'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'Monitor.FileGrowth'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [Monitor].[FileGrowth]
        (
        DatabaseName sysname &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
        DatabaseFileName nvarchar(260) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
        FileSizeMB &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(18,3) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; PK_MonitorFileGrowth &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt;(DatabaseName, DatabaseFileName)
        )
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'Alert.FileGrowth'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[FileGrowth]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

/*================================================================================
&lt;span style="color: #0000ff"&gt;Procedure&lt;/span&gt;:    [Alert].[FileGrowth] 
Author:        Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        2007-11-14

Synopsis:
    Procedures monitors the &lt;span style="color: #0000ff"&gt;size&lt;/span&gt; &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; &lt;span style="color: #0000ff"&gt;each&lt;/span&gt; &lt;span style="color: #0000ff"&gt;file&lt;/span&gt; &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; &lt;span style="color: #0000ff"&gt;user&lt;/span&gt; databases &lt;span style="color: #0000ff"&gt;and&lt;/span&gt; tempdb.  &lt;span style="color: #0000ff"&gt;In&lt;/span&gt;
    the event &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; &lt;span style="color: #0000ff"&gt;file&lt;/span&gt; growrh &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;any&lt;/span&gt; &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; the monitored databases, a error &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; raised
    that can be captured through either tools monitoring &lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; Servers log files &lt;span style="color: #0000ff"&gt;or&lt;/span&gt; 
    through &lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; Agent Alerts.
         

================================================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;            Description
--------------------------------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
================================================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[FileGrowth] 

&lt;span style="color: #0000ff"&gt;As&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; NOCOUNT &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;

&lt;span style="color: #008000"&gt;-- Validate that necessary error message exists&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; master..sysmessages &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; error = 70000)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; master..sp_addmessage  @msgnum = 70000, @severity = 12, @with_log = &lt;span style="color: #006080"&gt;'true'&lt;/span&gt;, 
        @msgtext = &lt;span style="color: #006080"&gt;'File growth has occured in the database %s on the file %s.  The size has increased from %d to %d.  If the file growth was unplanned, please review for unexpected issues.'&lt;/span&gt;, @replace = &lt;span style="color: #006080"&gt;'REPLACE'&lt;/span&gt;

&lt;span style="color: #008000"&gt;-- Insert files for each database that are not currently being watched&lt;/span&gt;
INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; [Monitor].[FileGrowth] (DatabaseName, DatabaseFileName, FileSizeM&lt;img src="http://stratesql.com/emoticons/cool.png" border="0" /&gt;
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; d.name, mf.name, &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(mf.&lt;span style="color: #0000ff"&gt;size&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;)*8/1024
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.databases d
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.master_files mf &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; d.database_id = mf.database_id
    &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; Monitor.FileGrowth fg &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; d.name = fg.DatabaseName &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; mf.name = fg.DatabaseFileName
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; d.state_desc = &lt;span style="color: #006080"&gt;'ONLINE'&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; source_database_id &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; d.name &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #006080"&gt;'model'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'master'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'msdb'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; fg.FileSizeMB &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;

&lt;span style="color: #008000"&gt;-- Delete databases that no longer exist&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;DELETE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Monitor.FileGrowth 
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Monitor.FileGrowth fg 
    &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.databases d &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fg.DatabaseName = d.name
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; d.name &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @FileGrowthDelta &lt;span style="color: #0000ff"&gt;table&lt;/span&gt;
    (
    DatabaseName sysname
    ,DatabaseFileName nvarchar(260) 
    ,OldFileSizeMB &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(18,3)
    ,NewFileSizeMB &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(18,3)
    )

&lt;span style="color: #008000"&gt;-- Update files that changed size and output delta rows&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;UPDATE&lt;/span&gt; fg
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; FileSizeMB = &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(mf.&lt;span style="color: #0000ff"&gt;size&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;)*8/1024 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(18,3))
&lt;span style="color: #0000ff"&gt;OUTPUT&lt;/span&gt; INSERTED.DatabaseName, INSERTED.DatabaseFileName, INSERTED.FileSizeMB, DELETED.FileSizeMB
&lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @FileGrowthDelta
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Monitor.FileGrowth fg 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.databases d &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; d.name = fg.DatabaseName 
    &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.master_files mf &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; d.database_id = mf.database_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; mf.name = fg.DatabaseFileName
&lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; d.state_desc = &lt;span style="color: #006080"&gt;'ONLINE'&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; source_database_id &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; d.name &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #006080"&gt;'model'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'master'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'msdb'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; FileSizeMB &amp;lt;&amp;gt; &lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(mf.&lt;span style="color: #0000ff"&gt;size&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;float&lt;/span&gt;)*8/1024 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(18,3))

--&lt;span style="color: #0000ff"&gt;Declare&lt;/span&gt; variables &lt;span style="color: #0000ff"&gt;section&lt;/span&gt; &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; triggering error event
&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @DatabaseName sysname
    ,@DatabaseFileName nvarchar(260) 
    ,@OldFileSizeMB &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;
    ,@NewFileSizeMB &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;

--&lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;each&lt;/span&gt; &lt;span style="color: #0000ff"&gt;database&lt;/span&gt; name &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; sysdatabases
&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; ALTER_FILE_GROWTH_CURSOR &lt;span style="color: #0000ff"&gt;CURSOR&lt;/span&gt; &lt;span style="color: #0000ff"&gt;LOCAL&lt;/span&gt; FAST_FORWARD &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; DatabaseName 
        ,DatabaseFileName 
        ,OldFileSizeMB 
        ,NewFileSizeMB
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; @FileGrowthDelta

&lt;span style="color: #0000ff"&gt;OPEN&lt;/span&gt; ALTER_FILE_GROWTH_CURSOR
&lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; ALTER_FILE_GROWTH_CURSOR &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @DatabaseName, @DatabaseFileName, @OldFileSizeMB, @NewFileSizeMB

&lt;span style="color: #0000ff"&gt;WHILE&lt;/span&gt; &lt;span style="color: #cc6633"&gt;@@FETCH_STATUS&lt;/span&gt; = 0
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;RAISERROR&lt;/span&gt;(70000, 0, 1, @DatabaseName, @DatabaseFileName, @OldFileSizeMB, @NewFileSizeM&lt;img src="http://stratesql.com/emoticons/cool.png" border="0" /&gt; &lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; LOG
    &lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; ALTER_FILE_GROWTH_CURSOR &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @DatabaseName, @DatabaseFileName, @OldFileSizeMB, @NewFileSizeMB    
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;CLOSE&lt;/span&gt; ALTER_FILE_GROWTH_CURSOR
&lt;span style="color: #0000ff"&gt;DEALLOCATE&lt;/span&gt; ALTER_FILE_GROWTH_CURSOR
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; [Alert].[FileGrowth]&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In the next post, I’ll outline the process that I use to check to see if there are any files that may need be running out of available space.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Presenting on Indexing at PASS Summit 2009</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/26/presenting-on-indexing-at-pass-summit-2009.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-26:2d1e533f-a22d-4f9f-b07b-d8ee3bbf391c</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="Performance Tuning" />
		<category term="PASS Summit" />
		<category term="Conference" />
		<updated>2009-06-26T18:55:00Z</updated>
		<published>2009-06-26T18:55:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://summit2009.sqlpass.org/AboutSummit/ROI/tabid/63/Default.aspx"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="PASS2009Color_300x250Attendance" border="0" alt="PASS2009Color_300x250Attendance" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/PASS2009Color_300x250Attendance_3.gif" width="161" height="135" /&gt;&lt;/a&gt; I tweeted it a couple Friday’s ago when I got the notice but I was on vacation and had made the decision to avoid blogging anything during that time.&amp;#160; &lt;/p&gt;  &lt;p&gt;But since vacation is over, here’s the session that got accepted:&lt;/p&gt;  &lt;blockquote&gt;   &lt;h3&gt;Getting To Know Your Indexes &lt;/h3&gt;    &lt;p&gt;Without proper indexing SQL Server can be hard pressed to create efficient and performant execution plans.&amp;#160; Dynamic Management Views (DMV) and system views provide a slew of information about indexes that can be used to analyze indexes within SQL Server.&amp;#160; In this session we’ll go under the hood of SQL Server to look at DMVs and system views to know what indexes you have, should have, and how they feel about the way applications are treating them. &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;      &lt;br /&gt;Understanding of performance tuning needs      &lt;br /&gt;Experience with Database design &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Goals:&lt;/strong&gt;      &lt;br /&gt;1.&amp;#160;&amp;#160;&amp;#160; Identify methods to analyze current and potential indexes      &lt;br /&gt;2.&amp;#160;&amp;#160;&amp;#160; Learn how to alleviate stress found on indexes      &lt;br /&gt;3.&amp;#160;&amp;#160;&amp;#160; Demonstrate methods for tuning indexes&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Have you &lt;a href="http://www.regonline.com/Checkin.asp?EventId=685107"&gt;registered for the PASS Summit&lt;/a&gt; yet?&amp;#160; If not and you need to convince someone, here are some &lt;a href="http://summit2009.sqlpass.org/AboutSummit/ROI/tabid/63/Default.aspx"&gt;good justifications&lt;/a&gt; for going.&amp;#160; My main motivation for going is the opportunity to meet new people in the community that have different visions on implementing SQL Server.&amp;#160; Also&lt;/p&gt;  &lt;p&gt;The one last reason to go is project “jager”.&amp;#160; &lt;/p&gt;</content>
	</entry>
	<entry>
		<title>This Wednesday ITCare Event - Solving Business Pains with SQL Server Integration Services</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/22/this-wednesday-itcare-event--solving-business-pains-with-sql-server-integration-services.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-22:be8f8cdd-ce33-4975-9d93-69adcc933764</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SSIS" />
		<category term="SQL 2005" />
		<category term="SQL 2008" />
		<updated>2009-06-22T13:00:00Z</updated>
		<published>2009-06-22T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/search-engine-img_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="search-engine-img" border="0" alt="search-engine-img" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/search-engine-img_thumb.jpg" width="159" height="172" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you’ve been looking for some free training on SQL Server Integration Services, I’ve got the answer for you.&amp;#160; The details are below and you can &lt;a href="http://www.nhmn.com/Courses/CrsDetail.aspx?C=NHITCare062409" target="_blank"&gt;register for the event here&lt;/a&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Course Overview&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;ITCare, delivered and hosted quarterly by our Partners is designed to keep you up to date on the cutting-edge technologies. ITCare is a FREE half-day technical seminar series created by IT Professionals for IT Professionals! We'll address the needs and issues today and show you how to make a real difference in the way that you work.&lt;/p&gt;    &lt;p&gt;SQL Server Integration Services (SSIS) offers a wide range of features and functionality that can be used to solve business pains within Extract, Transform, and Load (ETL) processes. These pains can be caused by the performance of current ETL process, the maintainability of ETL processes or represent a new pain that SSIS features can resolve. This presentation will provide a demonstration of real world scenarios where features of SSIS were used to solve business pains through modification of existing SSIS packages or through the creation of new SSIS packages. The session will also discuss current best practices in SSIS package design.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;1. Understand flexibility that SSIS features provide      &lt;br /&gt;2. Demonstrate application of SSIS functionality to business needs       &lt;br /&gt;3. Discuss current best practices in SSIS package design&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Audience&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;IT Administrators, IT Managers, Business Intelligence, DBA, SQL Server administrators.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Understanding of basic ETL concepts and basic T-SQL coding&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Course Length&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;1 Half Day&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Speaker: Jason Strate of Digineer, Inc.&lt;/b&gt;       &lt;br /&gt;Jason Strate has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft's published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition and actively blogs about SQL Server and related technologies. Also this past year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008 and presented at the SSWUG SQL Server Launch Event and the last two SSWUG Virtual SQL Server Conferences.&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>June PASSMN Meeting Today</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/15/june-passmn-meeting-tomorrow.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-16:173849cb-e8b0-457f-8c85-0d933eb39a08</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="Performance Tuning" />
		<category term="SQLServer" />
		<category term="MNSSUG" />
		<category term="SSAS" />
		<category term="SQL 2008" />
		<updated>2009-06-16T14:15:00Z</updated>
		<published>2009-06-16T14:15:00Z</published>
		<content type="html">&lt;p&gt;The weather says it’s supposed to be storming today.&amp;#160; What a better way to spend a rainy afternoon that in a conference room with your peers discussing SQL Server.&amp;#160; So come out at 2:30 PM for snacks and socializing and we’ll kick things off at 3:00 PM.&lt;/p&gt;  &lt;p&gt;We’ll be hearing about &lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=PASSEVT20090616"&gt;Analysis Services Dimension Creation Best Practices &amp;amp; Disks, Real and Virtual and What is Important for SQL Server&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;Feel free to contact me via e-mail (&lt;a href="mailto:jstrate@digineer.com"&gt;jstrate@digineer.com&lt;/a&gt;) or twitter (&lt;a href="http://twitter.com/stratesql"&gt;@stratesql&lt;/a&gt;) with questions or for more information.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>June PASSMN Meeting Tomorrow</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/15/june-passmn-meeting-tomorrow-2.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-15:61ef5055-4325-4bfc-b46c-6871569b165a</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="Performance Tuning" />
		<category term="SQLServer" />
		<category term="MNSSUG" />
		<category term="SSAS" />
		<category term="SQL 2008" />
		<updated>2009-06-15T16:00:00Z</updated>
		<published>2009-06-15T16:00:00Z</published>
		<content type="html">&lt;p&gt;If you are still trying to make plans for tomorrow afternoon… there is a PASSMN meeting you could attend.&amp;#160; This month we’ll be hearing about &lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=PASSEVT20090616"&gt;Analysis Services Dimension Creation Best Practices &amp;amp; Disks, Real and Virtual and What is Important for SQL Server&lt;/a&gt;.&amp;#160; The meeting starts at 3:00 PM and there will some snacks and socializing before hand.&lt;/p&gt;  &lt;p&gt;Feel free to contact me via e-mail (&lt;a href="mailto:jstrate@digineer.com"&gt;jstrate@digineer.com&lt;/a&gt;) or twitter (&lt;a href="http://twitter.com/stratesql"&gt;@stratesql&lt;/a&gt;) with questions or for more information.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>SQL Satur-What? Here Comes the East Iowa SQL Saturday</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/15/sql-saturwhat-here-comes-the-east-iowa-sql-saturday.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-15:7addd7a2-02e7-4272-b4e2-3e7b3e510852</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="Conference" />
		<updated>2009-06-15T13:00:00Z</updated>
		<published>2009-06-15T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/omg%20(1)_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" title="omg (1)" border="0" alt="omg (1)" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/omg%20(1)_thumb.jpg" width="138" height="138" /&gt;&lt;/a&gt; Did you hear?&amp;#160; The &lt;a href="http://sqlfool.com/2009/06/east-iowa-sql-saturday-call-for-speakers/" target="_blank"&gt;call for speakers for the East Iowa SQL Saturday!&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’ve submitted four sessions and plan on driving down for the weekend.&amp;#160; As Michelle points out it’s only a 5-hour down to the event.&amp;#160; The event is free and will have a number of tracks which are still TBD but should be a good event.&lt;/p&gt;  &lt;p&gt;Maybe if enough people from PASSMN head down there, they’ll join us when we try to put our event on.&amp;#160; Though our event is still pretty vapor.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>June ITCare Event - Solving Business Pains with SQL Server Integration Services</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/12/june-itcare-event--solving-business-pains-with-sql-server-integration-services.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-12:69a7a633-06c4-4899-8789-e5db490da790</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SSIS" />
		<category term="SQL 2005" />
		<updated>2009-06-12T13:00:00Z</updated>
		<published>2009-06-12T13:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/search-engine-img_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="search-engine-img" border="0" alt="search-engine-img" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/search-engine-img_thumb.jpg" width="159" height="172" /&gt;&lt;/a&gt;&amp;#160; Some lines got crossed with this month’s New Horizons ITCare event.&amp;#160; The topic and speaker have changed but the date is remaining the same.&amp;#160; Instead of the previous topic, I’ll be presenting on SQL Server Integration Services.&amp;#160; As I mentioned, the date of the event is still June 24th.&amp;#160; The event will be available online and you can &lt;a href="http://www.nhmn.com/Courses/CrsDetail.aspx?C=NHITCare062409" target="_blank"&gt;register for the event here&lt;/a&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Course Overview&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;ITCare, delivered and hosted quarterly by our Partners is designed to keep you up to date on the cutting-edge technologies. ITCare is a FREE half-day technical seminar series created by IT Professionals for IT Professionals! We'll address the needs and issues today and show you how to make a real difference in the way that you work.&lt;/p&gt;    &lt;p&gt;SQL Server Integration Services (SSIS) offers a wide range of features and functionality that can be used to solve business pains within Extract, Transform, and Load (ETL) processes. These pains can be caused by the performance of current ETL process, the maintainability of ETL processes or represent a new pain that SSIS features can resolve. This presentation will provide a demonstration of real world scenarios where features of SSIS were used to solve business pains through modification of existing SSIS packages or through the creation of new SSIS packages. The session will also discuss current best practices in SSIS package design.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;1. Understand flexibility that SSIS features provide      &lt;br /&gt;2. Demonstrate application of SSIS functionality to business needs       &lt;br /&gt;3. Discuss current best practices in SSIS package design&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Audience&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;IT Administrators, IT Managers, Business Intelligence, DBA, SQL Server administrators.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Understanding of basic ETL concepts and basic T-SQL coding&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Course Length&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;1 Half Day&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Speaker: Jason Strate of Digineer, Inc.&lt;/b&gt;       &lt;br /&gt;Jason Strate has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft's published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition and actively blogs about SQL Server and related technologies. Also this past year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008 and presented at the SSWUG SQL Server Launch Event and the last two SSWUG Virtual SQL Server Conferences.&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Oct 21 &amp;ndash; IT Care - Painting by Numbers, Update Your SQL Skills with New Paintbrushes</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/11/oct-21-ndash-it-care--painting-by-numbers-update-your-sql-skills-with-new-paintbrushes-2.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-11:eab88fb4-4deb-4033-a3d3-1ea4d249ff31</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SSIS" />
		<category term="SQL 2005" />
		<updated>2009-06-11T16:24:00Z</updated>
		<published>2009-06-11T16:24:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/star_wars_paint_by_numbers_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="star_wars_paint_by_numbers" border="0" alt="star_wars_paint_by_numbers" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/star_wars_paint_by_numbers_thumb.jpg" width="212" height="143" /&gt;&lt;/a&gt; This event is a ways out there but thought I’d start getting the word out now for this &lt;a href="http://en.wikipedia.org/wiki/Freegan" target="_blank"&gt;free&lt;/a&gt; event.&amp;#160; The session will be hosted by yours truly and feature tricks and tips that I’ve picked up and want to spread the word on.&lt;/p&gt;  &lt;p&gt;Here is the registration &lt;a href="http://www.nhmn.com/Courses/CrsDetail.aspx?C=NHITCare102109" target="_blank"&gt;link&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;And the details:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Course Overview&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;ITCare, delivered and hosted quarterly by our Partners is designed to keep you up to date on the cutting-edge technologies. ITCare is a FREE half-day technical seminar series created by IT Professionals for IT Professionals! We'll address the needs and issues today and show you how to make a real difference in the way that you work.&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;While not everyone may not be a great painter, there is an art form to writing great SQL statements. In this session we'll go over tips and tricks in writing SQL. We'll also review some popular bad practices and provide demonstrations to better change those velvet Elvis's to Rembrandts. As every paint brush can't produce a masterpiece, the same goes for SQL statements. Writing good SQL code requires the right brush. After this session, you'll have a few more paintbrushes and probably throw out a few that are no longer useful.&lt;/p&gt; 1. Review and discussion of common coding methods can impact performance.     &lt;br /&gt;2. Discussion of uncommon coding methods that can be used to improve performance.     &lt;br /&gt;3. Review and application of existing T-SQL functions.     &lt;p&gt;&lt;strong&gt;Audience&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Junior to mid-level SQL Server developers&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Understanding of basic T-SQL coding skills.&lt;/p&gt;    &lt;p&gt;     &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;     &lt;strong&gt;Speaker: &lt;/strong&gt;Jason Strate of Digineer, Inc. Jason Strate has been a Database Architect for over ten years. His experiences include designing and implementing both OLAP and OLTP solutions involving clustering servers, database monitoring and tuning, analysis services, DTS/Integration Services, Reporting Services, and Notification Services. Jason is actively involved with the local PASS chapter (SQL Server User Group); he is currently serving on the Executive Board and has presented at monthly meetings. Jason contributed to Microsoft's published white paper &amp;quot;Empowering Enterprise Solutions with SQL Server 2005 Enterprise Edition and actively blogs about SQL Server and related technologies. Also this past year, Jason participated in the development of Microsoft Certification exams for SQL Server 2008 and presented at the SSWUG SQL Server Launch Event and the last two SSWUG Virtual SQL Server Conferences.&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Really Search Cache for Execution Plans</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/04/really-search-cache-for-execution-plans.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-04:1dace67a-2714-4bcb-b423-c7d238fa47ef</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DBA" />
		<updated>2009-06-04T18:31:00Z</updated>
		<published>2009-06-04T18:31:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/hide.png"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="hide" border="0" alt="hide" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/hide_thumb.png" width="186" height="154"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Today’s stored procedure for the DBADiagnostics database is a re-hash of a post I did a couple months ago.&amp;nbsp; The reason for re-hashing the procedure is that when I used it last week I found out there were some serious issues with its results.&amp;nbsp; Some plans were being duplicated and the performance statistics weren’t accurate because of this.&amp;nbsp; And why not fix the issues and make a DBADiagnostics post out of it.&lt;/p&gt;  &lt;p&gt;In the &lt;a href="http://stratesql.com/2009/01/26/search-cache-for-execution-plans.aspx" target="_blank"&gt;previous version&lt;/a&gt;, I was using the execution count from &lt;a href="http://msdn.microsoft.com/en-us/library/ms189741.aspx" target="_blank"&gt;sys.dm_exec_query_stats&lt;/a&gt; to determine how often a plan was being executed.&amp;nbsp; In the DMV though the SQL statements in the may execute in varying counts depending on conditional logic.&lt;/p&gt;  &lt;p&gt;Instead of using the execution count from sys.dm_exec_query_stats the procedure now uses usecount from &lt;a href="http://msdn.microsoft.com/en-us/library/ms187404.aspx" target="_blank"&gt;sys.dm_exec_cached_plans&lt;/a&gt;; which represents how often the plan was used.&amp;nbsp; The execution count represented how often the statements in the plan were executed.&lt;/p&gt;  &lt;p&gt;The stored procedure accepts the following parameters:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;@Database: &lt;/b&gt;The database to search for plans within.&amp;nbsp; This value can be NULL.&lt;/li&gt;    &lt;li&gt;&lt;b&gt;@ObjectName: &lt;/b&gt;The name of the procedure to search for plans for.&amp;nbsp; This value can be NULL.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The procedure can use either or none of the variables.&amp;nbsp; Obviously with both variables empty the results will be for all cached plans on the server. &lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Utility'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt;(&lt;span style="color: #006080"&gt;'CREATE SCHEMA [Utility] AUTHORIZATION [dbo]'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.procedures &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; object_id = OBJECT_ID(&lt;span style="color: #006080"&gt;'Utility.CachedPlanSearch'&lt;/span&gt;))
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Utility].[CachedPlanSearch]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

/*============================================================
&lt;span style="color: #0000ff"&gt;Procedure&lt;/span&gt;:    [Utility].[CachedPlanSearch]
Author:       Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:         June 1, 2009
 
Synopsis:
    Searches cache &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; occurances &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; a &lt;span style="color: #0000ff"&gt;plan&lt;/span&gt; based &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; an
    &lt;span style="color: #0000ff"&gt;procedure&lt;/span&gt; &lt;span style="color: #0000ff"&gt;and&lt;/span&gt; &lt;span style="color: #0000ff"&gt;or&lt;/span&gt; &lt;span style="color: #0000ff"&gt;database&lt;/span&gt; name.  Results assumes that average
    execution &lt;span style="color: #0000ff"&gt;time&lt;/span&gt; &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; returned results &lt;span style="color: #0000ff"&gt;are&lt;/span&gt; &lt;span style="color: #0000ff"&gt;less&lt;/span&gt; &lt;span style="color: #0000ff"&gt;than&lt;/span&gt; 24 hours.

&lt;span style="color: #0000ff"&gt;Exec&lt;/span&gt; Utility.CachedPlanSearch
    @DatabaseName = &lt;span style="color: #006080"&gt;'msdb'&lt;/span&gt;
    ,@ObjectName = &lt;span style="color: #006080"&gt;'sp_sqlagent_get_startup_info'&lt;/span&gt;
 
============================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:         &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;                Description
----------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt; &lt;/span&gt;
============================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; Utility.CachedPlanSearch
    (
    @DatabaseName sysname = &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    ,@ObjectName sysname = &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    )
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;

;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; cteExecInfo
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; ( 
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; DB_NAME(st.dbid) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; database_name 
        ,OBJECT_NAME(st.objectid, st.dbid) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; object_name 
        ,cp.usecounts &lt;span style="color: #008000"&gt;-- Use in place of qs.execution_count for whole plan count&lt;/span&gt;
        ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(qs.total_worker_time)/(cp.usecounts*1.) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; avg_cpu_time 
        ,&lt;span style="color: #0000ff"&gt;CAST&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(qs.total_logical_reads + qs.total_logical_writes)/(cp.usecounts*1.) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; avg_io 
        ,&lt;span style="color: #0000ff"&gt;SUM&lt;/span&gt;(qs.total_elapsed_time)/(cp.usecounts)/1000 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; avg_elapsed_time_ms
        ,st.text &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; sql_text
        ,qs.plan_handle 
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.dm_exec_query_stats qs 
        &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; sys.dm_exec_cached_plans cp &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; qs.plan_handle = cp.plan_handle
        &lt;span style="color: #0000ff"&gt;CROSS&lt;/span&gt; APPLY sys.dm_exec_sql_text(qs.sql_handle) st 
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; (DB_NAME(st.dbid) = @DatabaseName &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULLIF&lt;/span&gt;(@DatabaseName,&lt;span style="color: #006080"&gt;''&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (OBJECT_NAME(st.objectid, st.dbid) = @ObjectName &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULLIF&lt;/span&gt;(@ObjectName, &lt;span style="color: #006080"&gt;''&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;GROUP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; st.dbid, st.objectid, cp.usecounts, st.text, qs.plan_handle 
) 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; cte.database_name 
    ,cte.object_name 
    ,cte.usecounts 
    ,cte.avg_cpu_time 
    ,cte.avg_io 
    ,&lt;span style="color: #0000ff"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;, DATEADD(ms, cte.avg_elapsed_time_ms, 0), 114) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; avg_elapsed_time
    ,qp.query_plan 
    ,cte.sql_text
&lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; cteExecInfo cte 
    &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; APPLY sys.dm_exec_query_plan(cte.plan_handle) qp 
&lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; cte.usecounts &lt;span style="color: #0000ff"&gt;DESC&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I’ve often found this procedure useful when people complain about the execution of a procedure.&amp;nbsp; Instead of pulling out performance tools and running test versions of the procedure this will provide the last plan that was used for the procedure. &lt;/p&gt;</content>
	</entry>
	<entry>
		<title>July PASSMN Meeting Date Changed</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/03/july-passmn-meeting-date-changed.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-03:b74d27c7-2cf8-452c-9f61-f485e4611e40</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="MNSSUG" />
		<updated>2009-06-03T20:00:00Z</updated>
		<published>2009-06-03T20:00:00Z</published>
		<content type="html">&lt;p&gt;At the last meeting of the PASSMN board, the date for the July meeting was changed from July 21 to July 14.&amp;#160; This was changed because of a conflict with some of the people invited to speak on the Ask the Experts panel.&lt;/p&gt;  &lt;p&gt;Speaking of which, we are still looking for a few more people to join in the panel discussion and be an Expert.&amp;#160; If you are interested or know someone that would be good to speak and will be in Minnesota on July 14, send me a DM on twitter at &lt;a href="http://twitter.com/stratesql" target="_blank"&gt;@stratesql&lt;/a&gt;.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>June PASSMN Meeting (6/16/2009)</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/02/june-passmn-meeting-6162009.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-02:bab45794-ec63-4a50-a486-98d69bc7a2ae</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="Performance Tuning" />
		<category term="MNSSUG" />
		<category term="SSAS" />
		<updated>2009-06-03T02:00:00Z</updated>
		<published>2009-06-03T02:00:00Z</published>
		<content type="html">&lt;p&gt;The topics and speakers for June PASSMN meeting have been announced.&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=PASSEVT20090616" target="_blank"&gt;Analysis Services Dimension Creation Best Practices &amp;amp; Disks, Real and Virtual and What is Important for SQL Server&lt;/a&gt;&lt;/h4&gt;  &lt;p&gt;June 16, 2009   &lt;br /&gt;3:00 PM - 5:15 PM     &lt;br /&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=PASSEVT20090616"&gt;Register Here&lt;/a&gt; or visit &lt;a href="http://www.mnssug.org/"&gt;http://www.mnssug.org/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Analysis Services Dimension Creation Best Practices&lt;/strong&gt;    &lt;br /&gt;&lt;em&gt;Speaker: Brian Larson, Superior Consulting Services&lt;/em&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Having dimensions that are well structured and function efficiently is key to having performant cubes and an important factor when encouraging users to use cubes for ad hoc reporting and interactive analysis. This session will look at best practices to observe when designing and creating dimensions in Analysis Services. &lt;/p&gt;    &lt;p&gt;Brian Larson has 24 years of experience in the computer industry and 20 years’ experience as a consultant creating custom database applications. He is the Chief of Technology and BI Practice Manager for Superior Consulting Services in Burnsville, Minnesota, a Microsoft Gold Certified Partner. Brian is a Microsoft Certified Solution Developer (MCSD) and a Microsoft Certified Database Administrator (MCDBA). &lt;/p&gt;    &lt;p&gt;Brian served as a member of the original Reporting Services development team as a consultant to Microsoft. In that role, he contributed to the original code base of Reporting Services. Brian has presented at national conferences and events, including the SQL Server Magazine Connections Conference, the PASS Community Summit, and the Microsoft Business Intelligence Conference, and has provided training and mentoring on Reporting Services and business intelligence across the country. He has been a contributor and columnist for SQL Server Magazine. Brian is the author of Microsoft SQL Server 2008 Reporting Services and Delivering Business Intelligence with Microsoft SQL Server 2008, both from McGraw-Hill Professional. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Disks, Real and Virtual and What is Important for SQL Server      &lt;br /&gt;&lt;/strong&gt;&lt;em&gt;Speaker: James Lorenzen, Xiotech Corporation &lt;/em&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;ol&gt;     &lt;li&gt;Introduction &lt;/li&gt;      &lt;li&gt;A brief history of Hard Drives &lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;How Moore’s Law applies &lt;/li&gt;        &lt;li&gt;The performance impact of large disks (Greater than 1 terabyte) &lt;/li&gt;        &lt;li&gt;Why bigger is not always better &lt;/li&gt;     &lt;/ol&gt;      &lt;li&gt;Storage topology – DAS, NAS, and SAN &lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;Definitions &lt;/li&gt;        &lt;li&gt;Where they fit in a data center &lt;/li&gt;     &lt;/ol&gt;      &lt;li&gt;Type of disks and interfaces available today &lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;More acronyms (SATA, SCSI, IDE, SSD, etc.)&lt;/li&gt;     &lt;/ol&gt;      &lt;li&gt;Where the different disks fit, performance and capacity &lt;/li&gt;      &lt;li&gt;RAID Definitions &lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;Why it came about &lt;/li&gt;        &lt;li&gt;RAID Levels (0 through 50, or so) &lt;/li&gt;     &lt;/ol&gt;      &lt;li&gt;How SQL Server uses the storage &lt;/li&gt;      &lt;ol&gt;       &lt;li&gt;The SQL Server file types &lt;/li&gt;        &lt;li&gt;The performance requirements of the different file types &lt;/li&gt;     &lt;/ol&gt;      &lt;li&gt;Questions &lt;/li&gt;   &lt;/ol&gt;    &lt;p&gt;James Lorenzen is a Technical Marketing Engineer at Xiotech Corporation. He is Xiotech’s database specialist with over 25 years of database experience, fifteen years of that working with relational databases, SQL Server and Oracle. At Xiotech, James has focused on how to configure the database storage on a SAN to achieve the best possible performance from the SQL Server database. Prior to joining Xiotech, James has worked as a DBA for various companies both as consultant and dedicated Database Administration Manager. James has presented at user group meetings, covering database configuration on SAN storage. He can be reached at &lt;a href="mailto:James_Lorenzen@Xiotech.com"&gt;James_Lorenzen@Xiotech.com&lt;/a&gt;. &lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>Oops&amp;hellip; A Lot Of Trees&amp;hellip; Jobs to Update</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/02/oopshellip-a-lot-of-treeshellip-jobs-to-update.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-02:00e26889-03d0-46f8-889d-6fa730c59a61</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL 2005" />
		<category term="DBA" />
		<updated>2009-06-02T13:06:00Z</updated>
		<published>2009-06-02T13:06:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/tornado-012_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="tornado-012" border="0" alt="tornado-012" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/tornado-012_thumb.jpg" width="209" height="158" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Yesterday I &lt;a href="http://stratesql.com/2009/06/01/does-a-job-really-fail-if-nobody-knows-about-it.aspx" target="_blank"&gt;posted about having an alert in place to know when SQL Agent jobs don’t have operators setup&lt;/a&gt;.&amp;#160; I’ve found this alert to be extremely useful, but often when its been shared it just leads to junk e-mail.&lt;/p&gt;  &lt;p&gt;The reason for this is when the alert is added to 5, 10, or 50 servers it usually brings back a large number of results the first couple times.&amp;#160; And all of the jobs listed need to be updated so that the alerts start going out as required.&lt;/p&gt;  &lt;p&gt;To alleviate the pain that the first execution can create, an maintenance procedure is included in the &lt;a href="http://stratesql.com/2009/05/29/dbadiagnostics-ndash-my-dba-database.aspx" target="_blank"&gt;DBADiagnostics&lt;/a&gt; database which allows for mass or bulk updating of all of the SQL Agent jobs on the SQL Server instance.&lt;/p&gt;  &lt;p&gt;The stored procedure accepts the following parameters:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;@operator&lt;/strong&gt;: The name of the SQL Agent Operator that should receive the alerts. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;@notify_level_email: &lt;/strong&gt;The type of notifications the job should send to e-mail.&amp;#160; The values for these can be found in help for &lt;a href="http://msdn.microsoft.com/en-us/library/ms188745.aspx" target="_blank"&gt;sp_update_job&lt;/a&gt;.&amp;#160; The value 2 translates to &lt;strong&gt;On Failure.&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;@notify_level_eventlog: &lt;/strong&gt;The type of notification the job should send to the event log.&amp;#160; The value 0 translates to &lt;strong&gt;Never&lt;/strong&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;
 
&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Maintenance'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt;(&lt;span style="color: #006080"&gt;'CREATE SCHEMA [Maintenance] AUTHORIZATION [dbo]'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;
 
&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'Maintenance.SQLAgentJobsNotifyUpdate'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; Maintenance.SQLAgentJobsNotifyUpdate
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

/*============================================================
&lt;span style="color: #0000ff"&gt;Procedure&lt;/span&gt;:    [Maintenance].[SQLAgentJobsNotifyUpdate]
Author:       Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:         June 1, 2009
 
Synopsis:
    Mass &lt;span style="color: #0000ff"&gt;update&lt;/span&gt; &lt;span style="color: #0000ff"&gt;all&lt;/span&gt; jobs &lt;span style="color: #0000ff"&gt;without&lt;/span&gt; notifications setup &lt;span style="color: #0000ff"&gt;with&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; settings. 

&lt;span style="color: #0000ff"&gt;Exec&lt;/span&gt; [Maintenance].[SQLAgentJobsNotifyUpdate] 
    @operator = &lt;span style="color: #006080"&gt;'DBA'&lt;/span&gt;
    ,@notify_level_email = 2
    ,@notify_level_eventlog = 0
 
============================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:         &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;                Description
----------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt; &lt;/span&gt;
============================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; Maintenance.SQLAgentJobsNotifyUpdate
    (
    @operator sysname
    ,@notify_level_email &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; = 2
    ,@notify_level_eventlog &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; = 0
    )
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @job_id uniqueidentifier

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; JOB_UPDATE &lt;span style="color: #0000ff"&gt;CURSOR&lt;/span&gt; FAST_FORWARD &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; job_id
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; msdb.dbo.sysjobs
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; notify_email_operator_id = 0
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; notify_level_eventlog = 0
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; enabled = 1

&lt;span style="color: #0000ff"&gt;OPEN&lt;/span&gt; JOB_UPDATE

&lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; JOB_UPDATE &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @job_id

&lt;span style="color: #0000ff"&gt;WHILE&lt;/span&gt; &lt;span style="color: #cc6633"&gt;@@FETCH_STATUS&lt;/span&gt; = 0
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; msdb.dbo.sp_update_job 
        @job_id=@job_id 
        ,@notify_level_email=@notify_level_email
        ,@notify_level_eventlog=@notify_level_eventlog
        ,@notify_email_operator_name=@operator

    &lt;span style="color: #0000ff"&gt;FETCH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NEXT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; JOB_UPDATE &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; @job_id
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;CLOSE&lt;/span&gt; JOB_UPDATE
&lt;span style="color: #0000ff"&gt;DEALLOCATE&lt;/span&gt; JOB_UPDATE&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;CAUTION:&amp;#160; &lt;/strong&gt;Since the procedure updates all jobs that don’t have notifications setup, check and double check before running this in a production environment to verify that the update it will do is exactly what you are looking for.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>But It Wasn&amp;rsquo;t My Job To Do The Backups!?</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/01/but-it-wasnrsquot-my-job-to-do-the-backups.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-01:3b89f47c-74e9-403e-9c14-b2c3e9aefa1b</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL 2005" />
		<category term="DBA" />
		<updated>2009-06-01T19:30:00Z</updated>
		<published>2009-06-01T19:30:00Z</published>
		<content type="html">&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="thomson_trust_fall" border="0" alt="thomson_trust_fall" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/thomson_trust_fall_thumb.jpg" width="130" height="171" /&gt;&lt;/p&gt;  &lt;p&gt;It’s happened a few times, I go out to assist with recovery from some sort of failure and the question of database backups results in an uncomfortable pause.&amp;#160; One group thought the other group was taking the backups and the other group didn’t know that the backups needed to be taken.&amp;#160; And neither group previously attempted to execute the recovery plan before a failure had occurred.&amp;#160; The end result is that the miscommunication resulted in a lack of necessary backups.&lt;/p&gt;  &lt;p&gt;The most common scenario where this occurs is when the network or backup team is taking the SQL Server backups through a third-party backup tool removing the DBA’s from the “backup” process.&amp;#160; In these cases, the DBAs tend to relinquish their responsibility for the backup process placing complete trust that the databases are being backed up.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Trust No On With Backups&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you are a DBA in this situation, don’t trust that the backups are just happening.&amp;#160; Confirm it.&amp;#160; Every day.&amp;#160; Verify it.&amp;#160; Every day.&amp;#160; It doesn’t matter the level of trust that exists between the DBAs and other groups, as a DBA it is critical that when a database failure occurs that the database can be recovered and that there is full confidence that the needed backups exist.&amp;#160; Users will only blame the DBAs when data can’t be recovered because that is what the DBAs are there for.&amp;#160; The users won’t care who should have taken the backups only that it doesn’t exist and the DBA let that happen.&lt;/p&gt;  &lt;p&gt;As a disclaimer, this isn’t an admonishment of other groups having backup responsibilities.&amp;#160; But the reality when other groups are active in the backup process, &lt;/p&gt;  &lt;p&gt;Now checking on backups every day can be tedious.&amp;#160; In the scenario I’m outlining in this post a separate team is executing the backups.&amp;#160; Should the DBAs check each database to make certain that backups are occurring on schedule?&amp;#160; Yes, but that doesn’t necessarily mean that each database needs to be opened in SSMS to verify this.&lt;/p&gt;  &lt;p&gt;Instead, I have an stored procedure that is executed multiple times a day, typically every few hours, to alert if a full and/or differential backup hasn’t been taken in the last XX number of hours.&amp;#160; This way the only concern is the databases who’s backup schedules have fallen outside of SLA.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;First the Setup&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Before unveiling the new stored procedure for checking backups, there are some other object that will be needed first.&amp;#160; These tables are used to configure this and other alerts and maintenance procedures.&amp;#160; I’m a big fan of having a single database management code base between all servers, rather than customizing stuff and losing changes from time to time.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Maintenance'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; sys.sp_executesql &lt;span style="color: #006080"&gt;'CREATE SCHEMA [Maintenance] AUTHORIZATION [dbo]'&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'Maintenance.ExcludeType'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [Maintenance].[ExcludeType]
    (
    [ExcludeTypeID] [tinyint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IDENTITY&lt;/span&gt;(1,1),
    [Description] [&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;](500) &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
    [CreateDate] [smalldatetime] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeType_CreateDate &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; GETDATE(),
    [CreateBy] [&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;](128) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeType_CreateBy &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; SUSER_SNAME(),
    [UpdateDate] [smalldatetime] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeType_UpdateDate &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; GETDATE(),
    [UpdateBy] [&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;](128) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeType_UpdateBy &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; SUSER_SNAME(),
    &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; [PK_ExcludeType] &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CLUSTERED&lt;/span&gt; ([ExcludeTypeID] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;]
    ) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;]

&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;UNIQUE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NONCLUSTERED&lt;/span&gt; &lt;span style="color: #0000ff"&gt;INDEX&lt;/span&gt; UIX_ExcludeType_Description &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; Maintenance.ExcludeType ([Description]) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; [Maintenance].[ExcludeType] &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; [Description] = &lt;span style="color: #006080"&gt;'BackupCheck'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    INSERT &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; [Maintenance].[ExcludeType] ([Description])
    &lt;span style="color: #0000ff"&gt;VALUES&lt;/span&gt; (&lt;span style="color: #006080"&gt;'BackupCheck'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'Maintenance.ExcludeDatabase'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [Maintenance].[ExcludeDatabase]
    (
    [DatabaseName] [sysname] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
    [ExcludeTypeID] [tinyint] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
    [ExcludeReason] [&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;](255) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;,
    [CreateDate] [smalldatetime] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeDatabase_CreateDate &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; GETDATE(),
    [CreateBy] [&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;](128) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeDatabase_CreateBy &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; SUSER_SNAME(),
    [UpdateDate] [smalldatetime] &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeDatabase_UpdateDate &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; GETDATE(),
    [UpdateBy] [&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;](128) &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; DF_ExcludeDatabase_UpdateBy &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; SUSER_SNAME(),
    &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; [PK_ExcludeDatabase] &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CLUSTERED&lt;/span&gt; ([DatabaseName] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;, [ExcludeTypeID] &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;]
    ) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;]
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.foreign_keys &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'FK_ExcludeDatabase_ExcludeTypeID_FROM_ExcludeType'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;ALTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; [Maintenance].[ExcludeDatabase] &lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CHECK&lt;/span&gt; 
    &lt;span style="color: #0000ff"&gt;ADD&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONSTRAINT&lt;/span&gt; [FK_ExcludeDatabase_ExcludeTypeID_FROM_ExcludeType] &lt;span style="color: #0000ff"&gt;FOREIGN&lt;/span&gt; &lt;span style="color: #0000ff"&gt;KEY&lt;/span&gt;([ExcludeTypeID]) &lt;span style="color: #0000ff"&gt;REFERENCES&lt;/span&gt; [Maintenance].[ExcludeType] ([ExcludeTypeID])
END&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;And then the Store Procedure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next code window has the stored procedure code for this alert.&amp;#160; A few things to point out for the alert.&amp;#160; First, the alert assumes that all databases have the same SLA for checking backups.&amp;#160; This point of this was that the alert would be configured for the most crucial databases and take the less crucial databases along for the ride.&amp;#160; Overly cautious is better than being under prepared when it comes to backups.&lt;/p&gt;

&lt;p&gt;Next, the procedure utilizes the table Maintenance.ExcludeDatabases.&amp;#160; This table serves as an exclusion table for this alert and some other maintenance processes that will be introduced in later posts.&amp;#160; On the cautionary side, I prefer processes that maintain all databases by default and excludes those that a conscious decision to exclude has been made.&amp;#160; I’d rather be safe than sorry.&amp;#160; &lt;strike&gt;Easier to keep my job this way.&lt;/strike&gt;&lt;/p&gt;

&lt;p&gt;To make certain the databases the alert isn’t checking databases that should be naturally ignored, the stored procedure ignore the following items as well:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;tempdb and model are ignored. &lt;/li&gt;

  &lt;li&gt;Any database with a source_database_id which indicates that it is a snapshot database. &lt;/li&gt;

  &lt;li&gt;Any database in standyby mode which represents scenario where logs are being restored. &lt;/li&gt;

  &lt;li&gt;Any database with a RESTORING or OFFLINE state.&amp;#160; These databases cannot be backed up in their current state. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lastly, the procedure accepts a few parameters to configure the alert.&amp;#160; The parameters are the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;@ToAddress:&lt;/strong&gt; the person, group, or mailbox that needs to receive the alert. &lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;@SubjectWarning: &lt;/strong&gt;a customizable message that can be added to the subject line of the e-mail alert. This was added so that when it is setup on pre-production and production servers the same alert code can be used on both servers but the subject line can include text informing the severity of the issue. &lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;@HoursSinceBackup: &lt;/strong&gt;the number of hours that the backups can age before an alert should be generated. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without further ado, here is the procedure:&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Alert'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt;(&lt;span style="color: #006080"&gt;'CREATE SCHEMA [Alert] AUTHORIZATION [dbo]'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.procedures &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; object_id = OBJECT_ID(&lt;span style="color: #006080"&gt;'Alert.BackupCheck'&lt;/span&gt;))
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[BackupCheck]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

/*================================================================================
&lt;span style="color: #0000ff"&gt;Procedure&lt;/span&gt;:    Alert.BackupCheck
Author:        Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        June 1, 2009

Synopsis:
    This &lt;span style="color: #0000ff"&gt;procedure&lt;/span&gt; &lt;span style="color: #0000ff"&gt;check&lt;/span&gt; the datbase &lt;span style="color: #0000ff"&gt;backup&lt;/span&gt; &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; done within a number &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; hours passed
    &lt;span style="color: #0000ff"&gt;into&lt;/span&gt; the &lt;span style="color: #0000ff"&gt;procedure&lt;/span&gt;.  


================================================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:        &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;            Description
--------------------------------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
================================================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[BackupCheck]
    (
    @ToAddress &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255)
    ,@SubjectWarning &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255) = &lt;span style="color: #006080"&gt;''&lt;/span&gt;
    ,@HoursSinceBackup &lt;span style="color: #0000ff"&gt;smallint&lt;/span&gt; = 36
    )
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; NOCOUNT &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)
    ,@Subject nvarchar(255)
    ,@Body nvarchar(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)
    ,@&lt;span style="color: #0000ff"&gt;RowCount&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;
    ,@DBCount &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @Subject = @SubjectWarning + &lt;span style="color: #0000ff"&gt;Space&lt;/span&gt;(1) + &lt;span style="color: #cc6633"&gt;@@Servername&lt;/span&gt; + &lt;span style="color: #006080"&gt;': Check Database Backup Not Done in the past '&lt;/span&gt;
        + &lt;span style="color: #0000ff"&gt;Convert&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;, @HoursSinceBackup) + &lt;span style="color: #006080"&gt;' Hours.'&lt;/span&gt;
    ,@Body = &lt;span style="color: #006080"&gt;'The following database files are not backed up with in '&lt;/span&gt;
        + &lt;span style="color: #0000ff"&gt;Convert&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;, @HoursSinceBackup) 
        + &lt;span style="color: #006080"&gt;' hour(s).  Please determine the cause of missing Backup(s).'&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;Char&lt;/span&gt;(13)
    ,@&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; = &lt;span style="color: #006080"&gt;'Set NoCount On; Select * From tempdb..tmpAlertResults'&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt; TRY  
    &lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #006080"&gt;'tempdb..tmpAlertResults'&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;TABLE&lt;/span&gt; tempdb..tmpAlertResults

    ;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; Excludes
    &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
        &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; DatabaseName
        &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; Maintenance.ExcludeDatabase ed
            &lt;span style="color: #0000ff"&gt;INNER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; Maintenance.ExcludeType et &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ed.ExcludeTypeID = et.ExcludeTypeID
        &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; et.Description = &lt;span style="color: #006080"&gt;'BackupCheck'&lt;/span&gt;
        )
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;CONVERT&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;, d.Name) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Database&lt;/span&gt; Name], 
        &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(backup_start_date) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Backup&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Start&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;], 
        &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(backup_finish_date) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Backup&lt;/span&gt; Finish &lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;],
        DATEDIFF(&lt;span style="color: #0000ff"&gt;hour&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(backup_start_date),GETDATE()) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [&lt;span style="color: #0000ff"&gt;Hour&lt;/span&gt; Since &lt;span style="color: #0000ff"&gt;Backup&lt;/span&gt;]
    &lt;span style="color: #0000ff"&gt;INTO&lt;/span&gt; tempdb..tmpAlertResults
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.databases d 
        &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; msdb..backupset bs &lt;span style="color: #0000ff"&gt;On&lt;/span&gt; d.Name = bs.database_name &lt;span style="color: #0000ff"&gt;ANd&lt;/span&gt; bs.type &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #006080"&gt;'D'&lt;/span&gt;,&lt;span style="color: #006080"&gt;'I'&lt;/span&gt;)
        &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; Excludes e &lt;span style="color: #0000ff"&gt;On&lt;/span&gt; d.Name = e.DatabaseName 
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; d.Name &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #006080"&gt;'tempdb'&lt;/span&gt;, &lt;span style="color: #006080"&gt;'model'&lt;/span&gt;) &lt;span style="color: #008000"&gt;-- Back ups not necessarily needed&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; source_database_id &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt; &lt;span style="color: #008000"&gt;-- If not NULL then database is a snapshot&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_in_standby = 0 &lt;span style="color: #008000"&gt;-- is_in_standby is read-only log shipped&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; state_desc &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #006080"&gt;'RESTORING'&lt;/span&gt;,&lt;span style="color: #006080"&gt;'OFFLINE'&lt;/span&gt;) &lt;span style="color: #008000"&gt;-- mirroring flag, offline check&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;GROUP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; d.Name
    &lt;span style="color: #0000ff"&gt;HAVING&lt;/span&gt; DATEDIFF(&lt;span style="color: #0000ff"&gt;hour&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(backup_start_date),GETDATE()) &amp;gt; @HoursSinceBackup
    &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(backup_start_date) &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NULL&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;ORDER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;BY&lt;/span&gt; &lt;span style="color: #0000ff"&gt;MAX&lt;/span&gt;(backup_start_date) &lt;span style="color: #0000ff"&gt;ASC&lt;/span&gt; 

    &lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; tempdb..tmpAlertResults)
    &lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;Exec&lt;/span&gt; msdb.dbo.sp_send_dbmail 
        @recipients = @ToAddress, 
        @subject = @Subject,
        @body = @Body,
        @execute_query_database = &lt;span style="color: #006080"&gt;'DBADiagnostics'&lt;/span&gt;,
        @query = @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt;,
        @query_result_separator = &lt;span style="color: #006080"&gt;'|'&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;END&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt; TRY 
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt; CATCH
    &lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @ErrState &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;,
        @ErrSev &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;,
        @ErrMsg &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)

    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @ErrSev = ERROR_SEVERITY(),
       @ErrState = ERROR_STATE(),
       @ErrMsg = ERROR_MESSAGE()

    &lt;span style="color: #0000ff"&gt;RAISERROR&lt;/span&gt; (@ErrMsg, @ErrSev, @ErrState)
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt; CATCH&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;
If anyone knows how to get the last modified date for a database that would be very helpful.&amp;#160; I’d like to add additional logic to the procedure that ignores databases that have been backed up at least once since being made read-only.

</content>
	</entry>
	<entry>
		<title>Does A Job Really Fail If Nobody Knows About It?</title>
		<link rel="alternate" href="http://stratesql.com/2009/06/01/does-a-job-really-fail-if-nobody-knows-about-it.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-06-01:a93531e0-6ea2-4f26-8548-b6937ad391b9</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL 2005" />
		<category term="DBA" />
		<updated>2009-06-01T16:00:00Z</updated>
		<published>2009-06-01T16:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/tree_down_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="tree_down" border="0" alt="tree_down" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/tree_down_thumb.jpg" width="139" height="184" /&gt;&lt;/a&gt; Have you ever gone out and made a new SQL Agent job and forget to assign notification settings for it? &lt;strike&gt;God, I hope I’m not the only one because that would mean I suck.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;This is a common issue that exists in most environments that I’ve worked in. &lt;strike&gt;So I must not suck.&lt;/strike&gt; Quite often I see SQL Agent Jobs executing throughout an organization and no one knows that a critical job has been failing day after day because the notifications where not setup for the job.&lt;/p&gt;  &lt;p&gt;Every environment has its own requirements for how notifications need to be aggregated and handled. Most often the SQL Agent jobs are configured to send e-mail notifications and then the person that receives the e-mail is charged with resolving the issue. Sometimes these e-mails are sent to applications that automatically generate a ticket that is then forwarded to the responsible individual. In other environments, the failed jobs are logged to the event log and a server monitoring tool collects the event log information and generates alerts based on these entries.&lt;/p&gt;  &lt;p&gt;The alert below was created with these two scenarios in mind. The procedure looks for jobs that don’t have either e-mail operators or an event log status set. To reduce clutter, it also ignores disabled jobs and jobs with the ‘Report Server’ category. The ‘Report Server’ category was mainly added to reduce noise from subscriptions created by reporting services.&lt;/p&gt;  &lt;p&gt;The procedure accepts two parameters:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;@ToAddress:&lt;/strong&gt; the person, group, or mailbox that needs to receive the alert. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;@SubjectWarning: &lt;/strong&gt;a customizable message that can be added to the subject line of the e-mail alert. This was added so that when it is setup on pre-production and production servers the same alert code can be used on both servers but the subject line can include text informing the severity of the issue. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Typically this procedure gets scheduled once a day in the morning so that any items it finds can be resolved before the day gets going.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;
 
&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.schemas &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'Alert'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt;(&lt;span style="color: #006080"&gt;'CREATE SCHEMA [Alert] AUTHORIZATION [dbo]'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;
 
&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.procedures &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'SQLAgentJobsWithoutNotify'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[SQLAgentJobsWithoutNotify]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;
 
/*============================================================
&lt;span style="color: #0000ff"&gt;Procedure&lt;/span&gt;:    [Alert].[SQLAgentJobsWithoutNotify]
Author:       Jason Strate
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:         8-11-2004
 
Synopsis:
 
&lt;span style="color: #0000ff"&gt;Exec&lt;/span&gt; [Alert].[SQLAgentJobsWithoutNotifyEmail] 
        @ToAddress = &lt;span style="color: #006080"&gt;'jstrate@hotmail.com'&lt;/span&gt;
        ,@SubjectWarning = &lt;span style="color: #006080"&gt;'TEST ALERT'&lt;/span&gt;
 
============================================================
Revision History:
&lt;span style="color: #0000ff"&gt;Date&lt;/span&gt;:         &lt;span style="color: #0000ff"&gt;By&lt;/span&gt;                Description
----------------------------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt; &lt;/span&gt;
============================================================*/
&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PROCEDURE&lt;/span&gt; [Alert].[SQLAgentJobsWithoutNotify]
    (
    @ToAddress &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255)
    ,@SubjectWarning &lt;span style="color: #0000ff"&gt;varchar&lt;/span&gt;(255) = &lt;span style="color: #006080"&gt;''&lt;/span&gt;
    )
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;
 
&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; *
    &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; msdb.dbo.sysjobs sj 
        &lt;span style="color: #0000ff"&gt;LEFT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;OUTER&lt;/span&gt; &lt;span style="color: #0000ff"&gt;JOIN&lt;/span&gt; msdb.dbo.syscategories c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; sj.category_id = c.category_id
    &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; sj.enabled = 1
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; sj.notify_email_operator_id = 0 
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; sj.notify_level_eventlog = 0
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; c.[Name] &amp;lt;&amp;gt; &lt;span style="color: #006080"&gt;'Report Server'&lt;/span&gt;)
&lt;span style="color: #0000ff"&gt;BEGIN&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @Subject nvarchar(500),
        @Body nvarchar(500),
        @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; nvarchar(&lt;span style="color: #0000ff"&gt;max&lt;/span&gt;)
 
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @Subject = @SubjectWarning + &lt;span style="color: #0000ff"&gt;SPACE&lt;/span&gt;(1) + &lt;span style="color: #cc6633"&gt;@@SERVERNAME&lt;/span&gt; + &lt;span style="color: #006080"&gt;': MSDB Job Notification Audit'&lt;/span&gt;,
        @Body = &lt;span style="color: #006080"&gt;'The following SQL Agent jobs do not have either e-mail or event log notifications configured to alert in the event that the job fails.'&lt;/span&gt;,
        @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt; = &lt;span style="color: #006080"&gt;'SET NOCOUNT ON; 
            SELECT CONVERT(varchar, COALESCE(sos.originating_server, @@SERVERNAME)) as [Originating Server], 
                CONVERT(varchar, sj.[name]) as [Job Name], 
                COALESCE(STUFF(STUFF(next_run_date, 7, 0, '&lt;/span&gt;&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;&lt;span style="color: #006080"&gt;'), 5, 0, '&lt;/span&gt;&lt;span style="color: #006080"&gt;'/'&lt;/span&gt;&lt;span style="color: #006080"&gt;') + Space(1) + 
                    STUFF(STUFF(next_run_time, 5, 0, '&lt;/span&gt;&lt;span style="color: #006080"&gt;':'&lt;/span&gt;&lt;span style="color: #006080"&gt;'), 3, 0, '&lt;/span&gt;&lt;span style="color: #006080"&gt;':'&lt;/span&gt;&lt;span style="color: #006080"&gt;'), '&lt;/span&gt;&lt;span style="color: #006080"&gt;'Unscheduled'&lt;/span&gt;&lt;span style="color: #006080"&gt;') as [Next Run Date],
                CONVERT(varchar, c.[name]) as [Category Name]
            FROM msdb.dbo.sysjobs sj 
                INNER JOIN msdb..sysjobschedules sjs ON sj.job_id = sjs.job_id
                LEFT OUTER JOIN msdb.dbo.syscategories c ON sj.category_id = c.category_id
                LEFT OUTER JOIN msdb.dbo.sysoriginatingservers sos ON sj.originating_server_id = sos.originating_server_id
            WHERE sj.enabled = 1
            AND sj.notify_email_operator_id = 0 
            AND sj.notify_level_eventlog = 0
            AND c.[Name] &amp;lt;&amp;gt; '&lt;/span&gt;&lt;span style="color: #006080"&gt;'Report Server'&lt;/span&gt;&lt;span style="color: #006080"&gt;''&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;EXEC&lt;/span&gt; msdb.dbo.sp_send_dbmail 
        @recipients = @ToAddress, 
        @subject = @Subject,
        @body = @Body,
        @execute_query_database = &lt;span style="color: #006080"&gt;'DBADiagnostics'&lt;/span&gt;,
        @query = @&lt;span style="color: #0000ff"&gt;SQL&lt;/span&gt;,
        @query_result_separator = &lt;span style="color: #006080"&gt;'|'&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;END&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;P.S.&amp;#160; This was supposed to go out last Friday which would have put some context around my other post on my DBADiagnostics database.&amp;#160; But I went to the lake instead… so yeah.&amp;#160; Priorities.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>DBADiagnostics &amp;ndash; My DBA Database</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/29/dbadiagnostics-ndash-my-dba-database.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-29:abb916e5-87a2-4070-b746-dbc59422c294</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="DBADiagnostics" />
		<category term="SQL 2005" />
		<updated>2009-05-29T13:00:00Z</updated>
		<published>2009-05-29T13:00:00Z</published>
		<content type="html">&lt;p&gt;A couple years ago I started consolidating all of my DBA scripts into a portable DBA database that I could use for diagnostics (hence the silly name) and for maintenance scripts. To help me to continue to be inspired to update the database and to get some feedback, I plan to post a number of the tables, procedures, and other database components over the next few weeks.&lt;/p&gt;  &lt;p&gt;Hopefully others will get as much use out of these as I have. To make it easier to find these posts, you can search my blog for the tag DBADiagnostics and all of those future posts should pop right up.&lt;/p&gt;  &lt;p&gt;For convenience sake, here’s is the script that I used to create the DBADiagnostics database:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;USE&lt;/span&gt; [master]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; &lt;span style="color: #0000ff"&gt;EXISTS&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; * &lt;span style="color: #0000ff"&gt;FROM&lt;/span&gt; sys.databases &lt;span style="color: #0000ff"&gt;WHERE&lt;/span&gt; name = &lt;span style="color: #006080"&gt;'DBADiagnostics'&lt;/span&gt;)
    &lt;span style="color: #0000ff"&gt;DROP&lt;/span&gt; &lt;span style="color: #0000ff"&gt;DATABASE&lt;/span&gt; [DBADiagnostics]
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;CREATE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;DATABASE&lt;/span&gt; [DBADiagnostics] &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; &lt;span style="color: #0000ff"&gt;PRIMARY&lt;/span&gt; (
    NAME = N&lt;span style="color: #006080"&gt;'DBADiagnostics'&lt;/span&gt;
    ,FILENAME = N&lt;span style="color: #006080"&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\DBADiagnostics.mdf'&lt;/span&gt; 
    ,&lt;span style="color: #0000ff"&gt;SIZE&lt;/span&gt; = 10240KB 
    ,MAXSIZE = UNLIMITED
    ,FILEGROWTH = 10240KB 
)
,FILEGROUP [&lt;span style="color: #0000ff"&gt;Data&lt;/span&gt;] &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt; (
    NAME = N&lt;span style="color: #006080"&gt;'DBADiagnostics_data'&lt;/span&gt;
    ,FILENAME = N&lt;span style="color: #006080"&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\DBADiagnostics_data.ndf'&lt;/span&gt; 
    ,&lt;span style="color: #0000ff"&gt;SIZE&lt;/span&gt; = 10240KB 
    ,MAXSIZE = UNLIMITED
    ,FILEGROWTH = 10240KB 
)
LOG &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; (
    NAME = N&lt;span style="color: #006080"&gt;'DBADiagnostics_log'&lt;/span&gt;
    ,FILENAME = N&lt;span style="color: #006080"&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\DBADiagnostics_log.ldf'&lt;/span&gt; 
    ,&lt;span style="color: #0000ff"&gt;SIZE&lt;/span&gt; = 10240KB 
    ,MAXSIZE = 2048GB 
    ,FILEGROWTH = 10240KB 
)
&lt;span style="color: #0000ff"&gt;GO&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
Of course, depending on your directory structure above you may need to change those values.</content>
	</entry>
	<entry>
		<title>Free Hyper-V Training</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/26/free-hyperv-training.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-26:0af0e30a-3473-4b54-b5f5-d2d35405ebf8</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="Certification" />
		<updated>2009-05-27T05:18:59Z</updated>
		<published>2009-05-27T05:18:59Z</published>
		<content type="html">&lt;p&gt;I was reading the &lt;a href="http://blogs.msdn.com/clustering/default.aspx" target="_blank"&gt;high-availability blog on MSDN&lt;/a&gt; today and &lt;a href="http://blogs.msdn.com/clustering/archive/2009/05/26/9641723.aspx" target="_blank"&gt;found a post with some free training&lt;/a&gt; mentioned within it.&amp;#160; Here are the details from the blog:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Microsoft is offering some free training for Hyper-V which includes modules on HA and Failover Clustering.&lt;/p&gt;    &lt;h5&gt;Free eLearning: Exam 70-652: TS: Windows Server Virtualization, Configuring&lt;/h5&gt;    &lt;p&gt;This collection of five 2-hour courses helps you develop the skills necessary for implementing and managing Hyper-V in an IT environment, as well as, creating and managing virtual machines and hosts in a virtual environment.      &lt;br /&gt;Use promo code: 9350-Y2W6-3676       &lt;br /&gt;The courses within the collection include the following topics:&lt;/p&gt;    &lt;p&gt;· An overview of the Hyper-V technology&lt;/p&gt;    &lt;p&gt;· Creating a virtual environment&lt;/p&gt;    &lt;p&gt;· Deploying systems in a virtual environment&lt;/p&gt;    &lt;p&gt;· &lt;b&gt;Configuring high availability in a virtual environment&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;· Administering a virtual environment with SCVMM&lt;/p&gt;    &lt;p&gt;Details: &lt;a href="https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=228779"&gt;https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=228779&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Exam Details: &lt;a href="http://www.microsoft.com/learning/en/us/exams/70-652.mspx"&gt;http://www.microsoft.com/learning/en/us/exams/70-652.mspx&lt;/a&gt;&lt;/p&gt;    &lt;h5&gt;Free eBook: Understanding Microsoft Virtualization Solutions&lt;/h5&gt;    &lt;p&gt;This guide will teach you about the benefits of the latest virtualization technologies and how to plan, implement, and manage virtual infrastructure solutions. The technologies covered include: Windows Server 2008 Hyper-V, System Center Virtual Machine Manager 2008, Microsoft Application Virtualization 4.5, Microsoft Enterprise Desktop Virtualization, and Microsoft Virtual Desktop Infrastructure.&lt;/p&gt;    &lt;p&gt;Details: &lt;a href="http://csna01.libredigital.com/?urmvs17u33"&gt;http://csna01.libredigital.com/?urmvs17u33&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>DreamSpark Certification Vouchers (aka Free Tests)</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/22/dreamspark-certification-vouchers-aka-free-tests.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-22:6b1f6447-95e6-47be-9bba-985ded73ac23</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="Certification" />
		<updated>2009-05-22T21:15:23Z</updated>
		<published>2009-05-22T21:15:23Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/GorgeJump2_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="GorgeJump2" border="0" alt="GorgeJump2" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/GorgeJump2_thumb.jpg" width="123" height="177" /&gt;&lt;/a&gt; I was reading &lt;a href="http://glennberrysqlperformance.spaces.live.com/default.aspx" target="_blank"&gt;Glenn Berry’s&lt;/a&gt; blog and found out about &lt;a href="http://glennberrysqlperformance.spaces.live.com/Blog/cns!45041418ECCAA960!1273.entry" target="_blank"&gt;an opportunity for free Microsoft Exam vouchers&lt;/a&gt;.&amp;#160; This is a great deal that is part of Microsoft’s DreamSpark program.&amp;#160; Through this program, students at accredited academic institutions can take &lt;a href="http://www.microsoft.com/learning/mcp/mcts/default.mspx" target="_blank"&gt;Microsoft Certified Technical Specialist&lt;/a&gt; exams for free.&amp;#160; &lt;/p&gt;  &lt;p&gt;As &lt;a href="http://stratesql.com/2009/05/18/your-2nd-chance-end-june-30.aspx" target="_blank"&gt;I mentioned the other day&lt;/a&gt;, there are a number of reasons to get certified.&amp;#160; One of these reasons that applies to students is that it helps bridge the experience gap.&amp;#160; Classes at school will help provide a foundation of the theoretical and a foundation to build a career upon.&amp;#160; Certifications provide a place to apply the information gained through school and apply towards the tools in the industry.&lt;/p&gt;  &lt;p&gt;Until a student is able to make the move from being a student to having a career and building experience, certifications provide a leg up to help you differentiate yourself from the crowd.&amp;#160; That extra dedication and commitment that may make the difference on your next interview.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Are You Down With The BPA?</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/21/are-you-down-with-the-bpa.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-21:696d3d5a-d2c4-499a-af06-c1bc8a2cfb74</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2005" />
		<category term="Tools and Tips" />
		<updated>2009-05-21T18:04:00Z</updated>
		<published>2009-05-21T18:04:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/flush_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="flush" border="0" alt="flush" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/flush_thumb.jpg" width="133" height="132" /&gt;&lt;/a&gt; Yesterday I talked about installing the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DA0531E4-E94C-4991-82FA-F0E3FBD05E63&amp;amp;displaylang=en" target="_blank"&gt;Best Practices Analyzer 2005&lt;/a&gt; (BPA) for a client that I was working with.&amp;#160; After some initial installation issues, I was ready to check out their SQL Server environment.&lt;/p&gt;  &lt;p&gt;While the tool was running, I started checking out the SQL Server event logs to see if there was anything interesting in the logs.&amp;#160; Of course there was, otherwise this would be a very short and uninteresting blog.&amp;#160; Counting successful backup messages in the log is how I roll.&lt;/p&gt;  &lt;p&gt;In the SQL Server event log there were a few interesting messages.&amp;#160; One in particular looked a lot like the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: XX seconds. Working set (K&lt;img src="http://stratesql.com/emoticons/cool.png" border="0" /&gt;: XX, committed (K&lt;img src="http://stratesql.com/emoticons/cool.png" border="0" /&gt;: XX, memory utilization: XX%.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Ah man, this doesn’t look good.&amp;#160; The message is talking about paging and performance degradation.&amp;#160; That always sound bad.&amp;#160; Of course, I started digging into the server to figure out what was causing these performance issues.&amp;#160; I found some promising information on this issue &lt;a href="http://msmvps.com/blogs/omar/archive/2007/09/19/a-significant-part-of-sql-server-process-memory-has-been-paged-out-this-may-result-in-performance-degradation.aspx" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/psssql/archive/2007/05/31/the-sql-server-working-set-message.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;While I was checking this information out, the Best Practice Analyzer finished its work.&amp;#160; I decided to wrap up the BPA work before getting too deep into this issue.&amp;#160; As I was exporting the report results, the first item in the list read the following:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;There are known issues that exist in Windows and various Device Drivers which can trigger conditions that result in working set of all processes currently running on the machine to be trimmed. This will cause excessive paging and result in drastic reduction in performance of all applications on the machine (specifically SQL Server).We found that TCPIP.SYS present with version [5.2.3790.4318] and BXVBDA.SYS is also present. So we recommend you to disable TCP Chimney.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This issue tracks back to the issue that I found in the SQL Server error log at the beginning of this post.&amp;#160; As a result of using the BPA to check out the client’s SQL Server instance a potentially difficult issue to resolve may be resolved with next to no effort.&lt;/p&gt;  &lt;p&gt;The client is currently implementing the recommendation and I should know shortly whether this resolved the issue.&amp;#160; I am fairly confident that this will resolve the issue for them but will follow up on this post when I know for certain.&lt;/p&gt;  &lt;p&gt;The lesson here is that BPA identified and offered a resolution for an issue that could have taken a lot of effort to resolve.&amp;#160; The question now is have you run BPA on your SQL Server environment to validate that your environment is up to snuff?&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>BPA Installs But Doesn&amp;rsquo;t Work</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/20/bpa-installs-but-doesnrsquot-work.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-20:90817e65-0c13-4065-84b1-76317f9af40f</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQL 2005" />
		<category term="Tools and Tips" />
		<updated>2009-05-20T14:00:00Z</updated>
		<published>2009-05-20T14:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/themondays_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="themondays" border="0" alt="themondays" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/themondays_thumb.jpg" width="200" height="150" /&gt;&lt;/a&gt; I was hoping to have a case of the Mondays the other day.&amp;#160; Whenever one hopes for “the Mondays”, Monday will always deliver.&amp;#160; I was using a new PC at a client and installing some tools for an assessment that I was working on.&lt;/p&gt;  &lt;p&gt;After some download and installing, Best Practices Analyzer 2005 was installed and ready to go.&amp;#160; I got the tool fired up and pointed it at the server I needed to look at and pressed go.&lt;/p&gt;  &lt;p&gt;And then it stopped…&amp;#160; I had an unhandled exception error.&lt;/p&gt;  &lt;p&gt;Not a big deal.&amp;#160; I can handle exception error because I can read.&amp;#160; After opening up the details window, the following was presented to me:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;See the &lt;span style="color: #0000ff"&gt;end&lt;/span&gt; &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; this message &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; details &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; invoking 
just-&lt;span style="color: #0000ff"&gt;in&lt;/span&gt;-&lt;span style="color: #0000ff"&gt;time&lt;/span&gt; (JIT) debugging instead &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; this dialog box.

************** &lt;span style="color: #0000ff"&gt;Exception&lt;/span&gt; Text **************
System.NullReferenceException: &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; reference &lt;span style="color: #0000ff"&gt;not&lt;/span&gt; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; an instance &lt;span style="color: #0000ff"&gt;of&lt;/span&gt; an &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;.
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; Microsoft.WindowsServerSystem.BestPracticesAnalyzer.UserInterface.BPALink.LinkClicked(&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; sender, EventArgs e)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.Control.OnClick(EventArgs e)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.Label.WndProc(Message&amp;amp; m)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.LinkLabel.WndProc(Message&amp;amp; msg)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   &lt;span style="color: #0000ff"&gt;at&lt;/span&gt; System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;SqlBPA2005&lt;/span&gt;
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.1009.00
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/Program%20Files/Microsoft%20SQL%20Server%202005%20Best%20Practices%20Analyzer/SqlBPA2005.exe
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;System.Windows.Forms&lt;/span&gt;
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;System&lt;/span&gt;
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;System.Drawing&lt;/span&gt;
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;BPA.UserInterface&lt;/span&gt;
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.1009.00
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/Program%20Files/Microsoft%20SQL%20Server%202005%20Best%20Practices%20Analyzer/BPA.UserInterface.DLL
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;BPA.Common&lt;/span&gt;
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.1009.00
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/Program%20Files/Microsoft%20SQL%20Server%202005%20Best%20Practices%20Analyzer/BPA.Common.DLL
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;SqlBPA.Shared&lt;/span&gt;
    Assembly Version: 9.0.242.0
    Win32 Version: 9.00.1009.00
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/Program%20Files/Microsoft%20SQL%20Server%202005%20Best%20Practices%20Analyzer/SqlBPA.Shared.DLL
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;System.Xml&lt;/span&gt;
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
&lt;span style="color: #008000"&gt;System.Configuration&lt;/span&gt;
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: &lt;span style="color: #0000ff"&gt;file&lt;/span&gt;:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
--------------------------------------&lt;span style="color: #008000"&gt;--&lt;/span&gt;
************** JIT Debugging **************
&lt;span style="color: #0000ff"&gt;To&lt;/span&gt; enable just-&lt;span style="color: #0000ff"&gt;in&lt;/span&gt;-&lt;span style="color: #0000ff"&gt;time&lt;/span&gt; (JIT) debugging, the .config &lt;span style="color: #0000ff"&gt;file&lt;/span&gt; &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; this
application &lt;span style="color: #0000ff"&gt;or&lt;/span&gt; computer (machine.config) must have the
jitDebugging &lt;span style="color: #0000ff"&gt;value&lt;/span&gt; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; the system.windows.forms &lt;span style="color: #0000ff"&gt;section&lt;/span&gt;.
The application must also be compiled &lt;span style="color: #0000ff"&gt;with&lt;/span&gt; debugging
enabled.

&lt;span style="color: #0000ff"&gt;For&lt;/span&gt; example:

&amp;lt;configuration&amp;gt;
    &amp;lt;system.windows.forms jitDebugging=&amp;quot;&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;&amp;quot; /&amp;gt;
&amp;lt;/configuration&amp;gt;

&lt;span style="color: #0000ff"&gt;When&lt;/span&gt; JIT debugging &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; enabled, &lt;span style="color: #0000ff"&gt;any&lt;/span&gt; unhandled &lt;span style="color: #0000ff"&gt;exception&lt;/span&gt;
will be sent &lt;span style="color: #0000ff"&gt;to&lt;/span&gt; the JIT debugger registered &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; the computer
rather &lt;span style="color: #0000ff"&gt;than&lt;/span&gt; be handled &lt;span style="color: #0000ff"&gt;by&lt;/span&gt; this dialog box.&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Great.&amp;#160; I can read – but not this.&amp;#160; I like error messages that are a little more direct that this.&lt;/p&gt;

&lt;p&gt;Fortunately, after a little digging I found &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/3a0096c5-f48d-46c6-9123-b8c5a7ac816e" target="_blank"&gt;a similar issue over at MSDN forums&lt;/a&gt;.&amp;#160; To solve this issue I needed to install both of the following SQL Server 2005 components:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Microsoft SQL Server Native Client &lt;/li&gt;

  &lt;li&gt;Microsoft SQL Server 2005 Management Objects Collection &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hadn’t expected this issue since I had SQL Server client tools installed on the PC that I was using.&amp;#160; The catch was though that I had the SQL Server 2008 tools installed, not the SQL Server 2005 tools.&lt;/p&gt;

&lt;p&gt;Where, oh where would I get these components?&amp;#160; Alas!&amp;#160; They are available in the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&amp;amp;DisplayLang=en" target="_blank"&gt;SQL Server 2005 Feature Pack&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now that I’ve got BPA installed it’s time to use it.&amp;#160; My question for you is do you use BPA?&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>SQL Load Generator</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/19/sql-load-generator.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-19:a82605e4-9aee-4e68-88c5-948fefdedace</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="Tools and Tips" />
		<updated>2009-05-19T16:30:00Z</updated>
		<published>2009-05-19T16:30:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/2455024205_f42b19c8d9_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="2455024205_f42b19c8d9" border="0" alt="2455024205_f42b19c8d9" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/2455024205_f42b19c8d9_thumb.jpg" width="172" height="116" /&gt;&lt;/a&gt; This &lt;a href="http://www.codeplex.com/SqlLoadGenerator" target="_blank"&gt;project has been on CodePlex&lt;/a&gt; for a while, but I thought I would give it a plug.&amp;#160; It’s a really good way to generate a load against a SQL Server without a lot of effort.&amp;#160; I’ve used it quite a number of times with presentations and use it when testing different code choices to see what happens when I run it often.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>May PASSMN Meeting Today</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/18/may-passmn-meeting-tomorrow.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-19:912c7a12-69d7-4e99-a849-52d7822764a5</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="PASS" />
		<category term="MNSSUG" />
		<updated>2009-05-19T13:30:00Z</updated>
		<published>2009-05-19T13:30:00Z</published>
		<content type="html">&lt;p&gt;It probably won’t be as interesting as Old School, but come out this afternoon if you are in the Twin Cities for the PASSMN meeting you could attend.&amp;#160; It starts at 3:00 PM and we meet at 2:30 PM for snacks and socializing.&amp;#160; And by snacks, I usually mean pizza but no promises.&amp;#160; &lt;/p&gt;  &lt;p&gt;We’ll be hearing about &lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=PASSEVT20090519"&gt;SSIS – Team Development, Deployment and Configuration &amp;amp; Securing and Troubleshooting Service Broker&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;Feel free to contact me via e-mail (&lt;a href="mailto:jstrate@digineer.com"&gt;jstrate@digineer.com&lt;/a&gt;) or twitter (&lt;a href="http://twitter.com/stratesql" target="_blank"&gt;@stratesql&lt;/a&gt;) with questions or for more information.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Your 2nd Chance End June 30</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/18/your-2nd-chance-end-june-30.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-18:f876179b-27a4-473e-a0fe-e1912b8c943e</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="Certification" />
		<updated>2009-05-18T15:26:00Z</updated>
		<published>2009-05-18T15:26:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/cheat_2.gif"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="cheat" border="0" alt="cheat" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/cheat_thumb.gif" width="133" height="174" /&gt;&lt;/a&gt; I’ve &lt;a href="http://stratesql.com/2006/02/21/microsoft-certification-second-shot-exam.aspx" target="_blank"&gt;mentioned&lt;/a&gt; the &lt;a href="http://www.microsoft.com/learning/mcp/offers/secondshot/default.mspx" target="_blank"&gt;2nd Chance Certification offer that Microsoft&lt;/a&gt; provides in the past.&amp;#160; And if you’ve tuned in at the PASS MN meetings, I’ve thrown the plug out there a few times.&lt;/p&gt;  &lt;p&gt;2nd Chance offers test takers the opportunity to take a run at an exam with the chance to take it a 2nd time for free if the first attempt isn’t successful.&amp;#160; It’s a great offer that I’ve used quite a few times in the past.&amp;#160; &lt;strike&gt;My co-workers reading this probably think I should can it on this offer since I am always bringing it up.&amp;#160; Hello, obsessive compulsive me.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;On top of that, right now you can also get an E-Learning Collection with the offer for just $35 more.&amp;#160; That’s a90% discount off the regular price.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;So there must be a catch…&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The offer expires on June 30th.&amp;#160; As in after next month it will no longer be available.&amp;#160; This offer has been available for quite some time, but don’t take it for granted and miss out on it.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;But who cares about certifications?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Will being certified make you an expert in the subject area of the exam?&amp;#160; Not at all, but it does show that you’ve got the determination to spend time studying on the subject.&amp;#160; It also shows that you’re minimally qualified to work with the technology that the exam covers.&amp;#160; &lt;/p&gt;  &lt;p&gt;Along the same lines, certifications cover a lot of features and functionality on their topics.&amp;#160; Most employers don’t have the opportunity to allow people to use all of those features and functionality in their environments.&amp;#160; When I was working on some of SQL Server 2008 exams last summer, we often talked about how cool it would be to work at an employer that used all of the features of SQL Server 2008 in a single environment.&lt;/p&gt;  &lt;p&gt;But unfortunately that environment doesn’t exist.&amp;#160; Or I haven’t found it yet…&amp;#160; &lt;/p&gt;  &lt;p&gt;Certifications, though, give you a reason to go out and find out about all those features that you don’t currently use, because they might be on the test.&amp;#160; Studying for certifications is one of the greatest benefits that getting certified will offer you.&lt;/p&gt;  &lt;p&gt;Another thing to think about with certifications is that with today’s uncertain economic conditions, a certification could be that bit that helps you get in the door for an interview.&amp;#160; Or maybe it’ll be the extra effort that your boss sees you putting in that keeps you in the door.&lt;/p&gt;  &lt;p&gt;As Brent mentioned a while back on his blog, &lt;a href="http://www.brentozar.com/archive/2009/04/certifications-are-the-icing-on-the-cake/" target="_blank"&gt;certifications are the icing on the cake&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why go for the 2nd chance?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You’re going to study, study, study, and study.&amp;#160; It takes time.&amp;#160; Time that you could do other things, like enjoying the summer or watching the new Star Trek movie.&amp;#160; &lt;strike&gt;Seriously, is anything left as canon anymore now that the timeline is fragged.&lt;/strike&gt;&amp;#160; Each day only has 24 hours in it and you need to prioritize.&amp;#160; The 2nd chance offer lets you do that.&lt;/p&gt;  &lt;p&gt;Suppose you planned to spend 40 hours studying and when life got in the way you only spent 20 hours studying.&amp;#160; Are you ready?&amp;#160; Should you re-schedule?&amp;#160; &lt;/p&gt;  &lt;p&gt;If you’ve been working with the technology for a few years and you may not need 40 hours to study.&amp;#160; You might already be ready and not know it.&amp;#160; Don’t reschedule.&amp;#160; Take the exam and see how you do.&lt;/p&gt;  &lt;p&gt;If you pass, that’s probably another 40 hours of free time that you would have tried to study and a bucket full of stress and guilt between choosing between a certification and your kids, wife, family, etc.&amp;#160; And if you don’t pass, you know exactly where to study versus going back and hitting all areas of the test.&amp;#160; Which might mean you only need to spend 10 hours studying before the next try.&amp;#160; Meaning more free time and less stress and guilt.&amp;#160; A definite win-win situation.&lt;/p&gt;  &lt;p&gt;So, are you willing to take your 2nd chance?&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>SQL Server 2008 R2</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/11/sql-server-2008-r2.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-11:6830e2cb-bed7-45c2-9788-e1ef7c12d7d2</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQL 2008" />
		<updated>2009-05-12T03:00:00Z</updated>
		<published>2009-05-12T03:00:00Z</published>
		<content type="html">&lt;p&gt;The final answer has &lt;strike&gt;mostly&lt;/strike&gt; arrived, the long awaited projects “Madison” and “Kilimanjaro” are getting near to CTP stage and will be available soon as SQL Server 2008 R2 CTP.&amp;#160; This was announced earlier today at TechEd; which also concided with the release of the &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx" target="_blank"&gt;SQL Server 2008 R2&lt;/a&gt; site.&lt;/p&gt;  &lt;p&gt;Some of the details from the new site:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&lt;em&gt;What's New in R2&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;With this new release, IT professionals, developers and business users will experience the following benefits:&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Capitalize on Hardware Innovation&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Increase in the number of logical processors supported from 64 up to 256.&amp;#160; This will provide customers with more choices for obtaining single system scalability with high performance.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Optimize Hardware Resources&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Dashboard viewpoints provide real-time insight into utilization and policy violations to help identify consolidation opportunities, maximize investments and maintain healthy systems.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Manage Efficiently at Scale&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Through new extensions in SQL Server Management Studio, organizations will gain insights into their growing applications and databases and help ensure higher service levels through policies and dashboard viewpoints.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Enhance Collaboration Across Development and IT&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Streamline Application Lifecycle Management through integration with Visual Studio. A new project type enables a single unit of management for packaging database schema with application requirements. This ensures higher quality application development while also accelerating deployments, moves, and changes over time.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Improve the Quality of Your Data&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Centralized approach to defining, deploying, and managing master data can ensure reporting consistency across systems and deliver faster more accurate results across the enterprise.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Manage User-Generated Analytical Applications&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Comprehensive management thru Microsoft SharePoint gives IT the ability to manage and secure all BI assets, thus freeing the original authors to focus on the priorities of the business.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Report with Ease&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;Decrease time and costs developing reports by giving users the ability to design their own queries, reports and charts through powerful and intuitive authoring and ad hoc reporting capabilities.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Get More Out of Your Data&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;New support for geospatial visualization can produce new insights and discoveries when geospatial data is combined with corporate data for reporting and analysis.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Build Robust Analytical Applications&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;With the in-memory analytics add-in for Microsoft Excel 2010, business users can quickly access, analyze and summarize vast amounts of data directly in Excel without the assistance of the IT department.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Consolidate Your Data&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;New “data mash up” capabilities will simplify time consuming data gathering and consolidation tasks.&amp;#160; Integrate data from multiple sources, including corporate databases and external sources, using powerful tools within Microsoft Excel.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;&lt;em&gt;Share and Collaborate with Confidence&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;New collaboration tools make it easy to share analytic applications and reports through Microsoft Office SharePoint, where they are refreshed automatically, maintained, and made accessible to others.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I’m really excited to play around with the CTP and dig into the MDM and multi-server management components.&amp;#160; Hopefully when the CTP is out I’ll find some time to try and post on the new features.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>From h4ppyd4y to StrateSQL</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/08/from-h4ppyd4y-to-stratesql.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-08:aaa77558-6ddf-4498-b7d2-439a88be6621</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<updated>2009-05-08T17:00:00Z</updated>
		<published>2009-05-08T17:00:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/twitter-buttons_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 0px 5px 5px; display: inline; border-top: 0px; border-right: 0px" title="twitter-buttons" border="0" alt="twitter-buttons" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/twitter-buttons_thumb.png" width="94" height="94" /&gt;&lt;/a&gt; I changed my twitter name from h4ppyd4y to &lt;a href="http://twitter.com/stratesql" target="_blank"&gt;StrateSQL&lt;/a&gt; earlier this week.&amp;#160; This shouldn’t have made much of a difference to people that are following me since twitter now allows for name changes without having to create a new account.&amp;#160; Very cool!&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Hopefully this change doesn’t confuse anyone.&amp;#160; If you aren’t using twitter, I do recommend it as a way to network with your SQL Server peers.&amp;#160; The videos below provide some insight into twitter.&amp;#160; Of better yet, check out &lt;a href="http://www.brentozar.com/archive/tag/twitter/" target="_blank"&gt;Brent Ozar’s twitter posts&lt;/a&gt;.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; padding-left: 0px; width: 425px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:cf43fb28-0f3d-4498-b197-2d866279712f" class="wlWriterEditableSmartContent"&gt;&lt;div id="fd1eaa96-6829-40cf-aeb2-98779ce8997e" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=ddO9idmax0o&amp;amp;hl=en&amp;amp;fs=1" target="_new"&gt;&lt;img src="http://stratesql.com/images/0/0/5/8/4/157902-148500/video77b9729f144c.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('fd1eaa96-6829-40cf-aeb2-98779ce8997e'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/ddO9idmax0o&amp;amp;hl=en&amp;amp;fs=1&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/ddO9idmax0o&amp;amp;hl=en&amp;amp;fs=1&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; padding-left: 0px; width: 425px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:00d8ad43-5537-4db7-a4e8-5648227264eb" class="wlWriterEditableSmartContent"&gt;&lt;div id="223ad717-ba55-4692-954e-5e6df6d3674e" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=PN2HAroA12w&amp;amp;hl=en&amp;amp;fs=1" target="_new"&gt;&lt;img src="http://stratesql.com/images/0/0/5/8/4/157902-148500/video3dfb173a8562.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('223ad717-ba55-4692-954e-5e6df6d3674e'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/PN2HAroA12w&amp;amp;hl=en&amp;amp;fs=1&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/PN2HAroA12w&amp;amp;hl=en&amp;amp;fs=1&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>More Parallelism</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/08/more-parallelism.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-08:ceb7cd49-2f82-44a6-8568-adfe8bfa5edf</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="Parallelism" />
		<updated>2009-05-08T14:15:00Z</updated>
		<published>2009-05-08T14:15:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/ladder_tree1_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="ladder_tree1" border="0" alt="ladder_tree1" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/ladder_tree1_thumb.jpg" width="178" height="138" /&gt;&lt;/a&gt; It’s quite often at clients that I spend time working on issues revolving around parallelism.&amp;#160; In fact, just this week it’s been the single most irritating performance problem that I’ve had to deal with.&amp;#160; &lt;/p&gt;  &lt;p&gt;If you aren’t up to snuff on parallelism there are a couple places I would start with getting up to speed:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/jimmymay/archive/2008/11/28/case-study-part-1-cxpacket-wait-stats-max-degree-of-parallelism-option-introduction-to-using-wait-stats-to-identify-remediate-query-parallelism-bottlenecks.aspx" target="_blank"&gt;Case Study: Part 1: CXPACKET Wait Stats &amp;amp; 'max degree of parallelism' Option: Introduction to Using Wait Stats to Identify &amp;amp; Remediate Query Parallelism Bottlenecks&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/jimmymay/archive/2008/12/02/case-study-part-2-cxpacket-wait-stats-max-degree-of-parallelism-option-suppressing-query-parallelism-eliminated-cxpacket-waits-liberated-30-of-cpu.aspx" target="_blank"&gt;Case Study: Part 2: CXPACKET Wait Stats &amp;amp; 'max degree of parallelism' Option: Suppressing Query Parallelism Eliminated CXPACKET Waits &amp;amp; Liberated 30% of CPU&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Both articles are from &lt;a href="http://blogs.msdn.com/jimmymay/default.aspx" target="_blank"&gt;Jimmy May&lt;/a&gt; (&lt;a href="http://twitter.com/aspiringgeek" target="_blank"&gt;@aspiringgeek&lt;/a&gt;), who writes some great articles on SQL Server performance and scalability.&lt;/p&gt;  &lt;p&gt;Two days ago, I was working on trying to determine which queries were causing the most trouble when it came to parallelism.&amp;#160; That was when I modified the &lt;a href="http://stratesql.com/2009/05/05/querying-for-parallelism.aspx" target="_blank"&gt;current queries executing with parallelism query&lt;/a&gt; to make it more useful.&amp;#160; And a few days before I posted &lt;a href="http://stratesql.com/2009/04/27/find-query-plans-that-may-utilize-parallelism.aspx" target="_blank"&gt;some queries that I also use to determine plans that may utilize parallelism&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;While working on these parallelism issues, I started wondering if identifying query plans utilizing parallelism by CPU was the correct approach.&amp;#160; Just because an execution plan has high CPU doesn’t necessarily mean that it is the biggest contributor or source of parallelism on the server.&amp;#160; &lt;/p&gt;  &lt;p&gt;Instead, I started looking at execution counts of the plans.&amp;#160; The query that I’ll be listing below provided a stark indication of the highest contributor to parallelism in the issues I was working on by identify a single query plan that was utilizing parallelism and had been executed nearly a 100 thousand times since I’d cleared the procedure cache that morning.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; TOP 50
    &lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; p.dbid = 32767 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #008000"&gt;'{RESOURCE}' ELSE DB_NAME(p.dbid) END as database_name&lt;/span&gt;
    ,OBJECT_NAME(p.objectid, p.dbid) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; [object_name]
    ,qs.execution_count
    ,qs.total_worker_time
    ,qs.total_logical_reads
    ,CONVERT(&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,3),qs.total_elapsed_time/1000000./qs.execution_count) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; avg_elapsed_time_sec
    ,&lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; statement_end_offset &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; -1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; q.text
        &lt;span style="color: #0000ff"&gt;ELSE&lt;/span&gt; SUBSTRING(q.text, statement_start_offset/2, (statement_end_offset-statement_start_offset)/2) &lt;span style="color: #0000ff"&gt;END&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; sql_statement
    ,p.query_plan
    ,q.text
    ,cp.plan_handle
FROM sys.dm_exec_query_stats qs
    INNER JOIN sys.dm_exec_cached_plans cp &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; qs.plan_handle = cp.plan_handle
    CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) p
    CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; q
WHERE cp.cacheobjtype = &lt;span style="color: #008000"&gt;'Compiled Plan' &lt;/span&gt;
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; p.query_plan.value(&lt;span style="color: #008000"&gt;'declare namespace p=&amp;quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&amp;quot;;max(//p:RelOp/@Parallel)', 'float') &amp;gt; 0&lt;/span&gt;
ORDER BY qs.execution_count DESC&lt;/pre&gt;
&lt;/div&gt;
Now that I’ve shared this, what do you the reader use to identify queries that are utilizing parallelism in your environments?</content>
	</entry>
	<entry>
		<title>May PASSMN Meeting (05/19/2009)</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/07/may-passmn-meeting-05192009.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-07:c3c803a7-a849-4ef5-8625-f3a4344ef981</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="PASS" />
		<category term="SSIS" />
		<category term="SQLServer" />
		<category term="MNSSUG" />
		<updated>2009-05-07T14:15:00Z</updated>
		<published>2009-05-07T14:15:00Z</published>
		<content type="html">&lt;p&gt;The topics and speakers for this months PASSMN meeting have been announced…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.digitalconcourse.com/getdigi/dc4main.asp?p=210&amp;amp;ConfCode=PASSEVT20090519" target="_blank"&gt;SSIS – Team Development, Deployment and Configuration &amp;amp; Securing and Troubleshooting Service Broker&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;May 19, 2009    &lt;br /&gt;3:00 PM - 5:15 PM&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SSIS – Team Development, Deployment and Configuration&lt;/strong&gt;     &lt;br /&gt;&lt;em&gt;Speaker: Dan English, Magenic &lt;/em&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;SQL Server Integration Services (SSIS) provides enterprise-class scalability, advanced data-integration architecture, and high-performance processing. Many enterprise environments are developing centralized services and standards to support their SQL Server Integration Services platform. During this session you will learn considerations and solutions for team development and how to leverage the power of package configurations for deploying packages to multiple environments. &lt;/p&gt;    &lt;p&gt;&lt;b&gt;Dan English &lt;/b&gt;- Dan is a Principal Consultant with Magenic and has been developing with Microsoft technologies for over 12 years and has over 5 years experience with Data Warehousing and Business Intelligence. He has been working with SQL Server since version 6.5 and now with 2008 looking towards the Kilimanjaro release. Dan has screencasts of SQL Server 2008 and PerformancePoint Server on YouTube and Soapbox ( keyword search - Magenic) and is an avid blogger (&lt;a href="http://denglishbi.spaces.live.com"&gt;http://denglishbi.spaces.live.com&lt;/a&gt;). Dan is fully certified with MS SQL Server 2005 and 2008 Business Intelligence. He enjoys keeping in contact with the community at large responding to forum postings on the Microsoft forums and SQL Server Central areas. Dan is also part of the PASSMN 2009 Executive Board. &lt;/p&gt; &lt;/blockquote&gt; &lt;u&gt;&lt;/u&gt;  &lt;p&gt;&lt;strong&gt;Securing and Troubleshooting Service Broker &lt;/strong&gt;    &lt;br /&gt;&lt;em&gt;Speaker: Eric Strom, RELS&lt;/em&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Tired of reading “Hello World” articles about Service Broker? Looking for more information but not finding good resources on securing and troubleshooting Service Broker applications? In this presentation, I will discuss some good security practices and share some lessons I learned while implementing and troubleshooting a medium-sized Service Broker application. Expect to learn about securing and troubleshooting Service Broker. A basic understanding of the Service Broker architecture is helpful. &lt;/p&gt;    &lt;p&gt;&lt;b&gt;Eric Strom &lt;/b&gt;is a Senior Database Administrator at the RELS Companies and is a member of the PASSMN 2009 Executive Board. He has been a SQL Server DBA since 2001 and specializes in performance tuning. Eric studied database theory at the University of Minnesota to earn a B.S. in Computer Science. He loves exchanging ideas with peers and is always looking for a good discussion.&lt;/p&gt;&lt;/blockquote&gt;</content>
	</entry>
	<entry>
		<title>I Didn&amp;rsquo;t Receive My Subscription</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/07/i-didnrsquot-receive-my-subscription.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-07:e497e75e-d2fd-4b49-be4f-12e7a7a0e8ef</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL RS" />
		<category term="SQL 2005" />
		<updated>2009-05-07T13:25:00Z</updated>
		<published>2009-05-07T13:25:00Z</published>
		<content type="html">&lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/magnifyGuy_2.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 10px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="magnifyGuy" border="0" alt="magnifyGuy" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/magnifyGuy_thumb.jpg" width="156" height="118" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Ever have a Reporting Services (SSRS) subscription that didn’t fire off as you thought it should?&amp;#160; Or was SQL Agent offline when subscriptions should have been fired?&amp;#160; Or did you just create a subscription and want to find out if it’s been configured properly? &lt;/p&gt;  &lt;p&gt;Fortunately all of the information is sitting neatly and plainly in your SQL Server database.&amp;#160; Unfortunately it the plainly part isn’t quite the truth.&amp;#160; If you’ve looked before, subscriptions are named with uniqueidentifiers.&amp;#160; These values don’t exactly read in a manner that help identify which subscription they correspond to. &lt;/p&gt;  &lt;p&gt;The query below provides a list of all current subscriptions in SSRS and also the last execution date.&amp;#160; The final column has the SQL syntax that would be needed to start the job to execute the subscription.&amp;#160; A little modification and the query can also be used to find execution history on the subscription. &lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; cte (job_id, job_name, execution_time, execution_order) 
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; 
( 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; DISTINCT j.job_id 
    ,j.name 
    ,CONVERT(datetime, STUFF(STUFF(run_date,7,0,&lt;span style="color: #008000"&gt;'/'),5,0,'/') &lt;/span&gt;
        + SPACE(1) 
        + STUFF(STUFF(RIGHT(&lt;span style="color: #008000"&gt;'000000' + CONVERT(varchar(20), run_time), 6),5,0,':'),3,0,':'))&lt;/span&gt;
    ,ROW_NUMBER() OVER (PARTITION BY j.job_id ORDER BY CONVERT(datetime, STUFF(STUFF(run_date,7,0,&lt;span style="color: #008000"&gt;'/'),5,0,'/') &lt;/span&gt;
        + SPACE(1) 
        + STUFF(STUFF(RIGHT(&lt;span style="color: #008000"&gt;'000000' + CONVERT(varchar(20), run_time), 6),5,0,':'),3,0,':')) DESC)&lt;/span&gt;
FROM msdb.dbo.sysjobs j (nolock) 
    INNER JOIN msdb.dbo.syscategories c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; j.category_id = c.category_id
    LEFT OUTER JOIN msdb.dbo.sysjobhistory jh (nolock) &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; j.job_id = jh.job_id 
WHERE c.name =&lt;span style="color: #008000"&gt;'Report Server'&lt;/span&gt;
) 
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
    x.job_name 
    ,c.name 
    ,x.execution_time
    ,c.path 
    ,su.description 
    ,CONVERT(varchar(max), su.ExtensionSettings) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; ExtensionSettings 
    ,&lt;span style="color: #008000"&gt;'EXEC msdb..sp_start_job ''' + x.job_name + '''' as SQLStatement&lt;/span&gt;
FROM cte x 
    INNER JOIN dbo.Schedule sc &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; x.job_name = CONVERT(varchar(100), sc.ScheduleID) 
    INNER JOIN dbo.ReportSchedule rs &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; sc.ScheduleID = rs.ScheduleID 
    INNER JOIN dbo.Subscriptions su &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; rs.SubscriptionID = su.SubscriptionID 
    INNER JOIN dbo.Catalog c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; su.Report_OID = c.ItemID 
WHERE execution_order = 1
ORDER BY 3, 2&lt;/pre&gt;
&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>Finding Objects In Schema</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/06/finding-objects-in-schema.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-06:a786130f-cefc-4d87-afa6-715632c0fd0e</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<updated>2009-05-07T05:15:15Z</updated>
		<published>2009-05-07T05:15:15Z</published>
		<content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://stratesql.com/images/0/0/5/8/4/157902-148500/sherlock-squirrel_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 10px 10px 10px 0px; display: inline; border-top: 0px; border-right: 0px" title="sherlock-squirrel" border="0" alt="sherlock-squirrel" align="right" src="http://stratesql.com/images/0/0/5/8/4/157902-148500/sherlock-squirrel_thumb.jpg" width="91" height="215" /&gt;&lt;/a&gt;A while back I was asked to identify schemas that didn’t have any objects.&amp;#160; Since it was a useful query, I thought I’d share it.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 80.15%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 164px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; s.name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; schema_name 
    ,COALESCE(o.type_desc, &lt;span style="color: #008000"&gt;'--NO ITEMS--') as type_desc&lt;/span&gt;
    ,NULLIF(COUNT(DISTINCT o.name),0) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; item_count
FROM sys.schemas s 
    LEFT OUTER JOIN sys.all_objects o &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; s.schema_id = o.schema_id 
WHERE s.name &lt;span style="color: #0000ff"&gt;NOT&lt;/span&gt; &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #008000"&gt;'INFORMATION_SCHEMA', 'sys') &lt;/span&gt;
GROUP BY s.name, o.type_desc
ORDER BY s.name, o.type_desc&lt;/pre&gt;
&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>Querying for Parallelism</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/05/querying-for-parallelism.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-05:0b03f230-54ed-47d9-9663-de1d7d0ed5ac</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DM Views" />
		<updated>2009-05-06T05:04:19Z</updated>
		<published>2009-05-06T05:04:19Z</published>
		<content type="html">&lt;p&gt;While working on some parallelism issues today I started using the query that detects whether there are queries currently running utilizing parallelism.&amp;#160; It’s the same query that can be found in the white paper &lt;a href="http://download.microsoft.com/download/1/3/4/134644fd-05ad-4ee8-8b5a-0aed1c18a31e/TShootPerfProbs.doc" target="_blank"&gt;Troubleshooting Performance Problems in SQL Server 2005&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Which I’ve included below:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 124px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
    r.session_id,
    r.request_id,
    MAX(ISNULL(exec_context_id, 0)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; number_of_workers,
    r.sql_handle,
    r.statement_start_offset,
    r.statement_end_offset,
    r.plan_handle
FROM 
    sys.dm_exec_requests r
    JOIN sys.dm_os_tasks t &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; r.session_id = t.session_id
    JOIN sys.dm_exec_sessions s &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; r.session_id = s.session_id
WHERE 
    s.is_user_process = 0x1
GROUP BY 
    r.session_id, r.request_id, 
    r.sql_handle, r.plan_handle, 
    r.statement_start_offset, r.statement_end_offset
HAVING MAX(ISNULL(exec_context_id, 0)) &amp;gt; 0&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;It sure is to know the queries currently executing using parallelism.&amp;#160; But the query doesn’t provide enough information when it executes to take some immediate action without further research.&amp;#160; The query below provides this additional information.&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; CurrentParallelism
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
        r.session_id
        ,r.request_id
        ,r.database_id
        ,MAX(ISNULL(exec_context_id, 0)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; number_of_workers
        ,r.sql_handle
        ,r.statement_start_offset
        ,r.statement_end_offset
        ,r.plan_handle
    FROM sys.dm_exec_requests r
        INNER JOIN sys.dm_os_tasks t &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; r.session_id = t.session_id
        INNER JOIN sys.dm_exec_sessions s &lt;span style="color: #0000ff"&gt;on&lt;/span&gt; r.session_id = s.session_id
    WHERE s.is_user_process = 0x1
    GROUP BY 
        r.session_id, r.request_id, r.database_id,
        r.sql_handle, r.plan_handle, 
        r.statement_start_offset, r.statement_end_offset
    HAVING MAX(ISNULL(exec_context_id, 0)) &amp;gt; 0
)
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt;
    cp.session_id
    ,cp.request_id
    ,db_name(cp.database_id) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; database_name
    ,cp.number_of_workers
    ,&lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; statement_end_offset &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; -1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; q.text
        &lt;span style="color: #0000ff"&gt;ELSE&lt;/span&gt; SUBSTRING(q.text, statement_start_offset/2, (statement_end_offset-statement_start_offset)/2) &lt;span style="color: #0000ff"&gt;END&lt;/span&gt; &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; sql_statement
    ,p.query_plan
    ,q.text
    ,cp.plan_handle
FROM CurrentParallelism cp
    CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) p
    CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; q&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The information that I like to have on hand is the exact statement and query plan that is executing so that I know what it is that I am dealing with.&amp;#160; Hopefully others feel the same and find some use in this.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Please Update Your RSS Subscription</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/05/please-update-your-rss-subscription.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-05:8167906d-6196-4241-a273-0c69c77d4143</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<updated>2009-05-06T04:07:20Z</updated>
		<published>2009-05-06T04:07:20Z</published>
		<content type="html">&lt;p&gt;&lt;/p&gt; To make things easier on both you and myself, please update your RSS feed to &lt;a href="http://feeds2.feedburner.com/StrateSql"&gt;http://feeds2.feedburner.com/StrateSql&lt;/a&gt;.&amp;#160; In the next month or two I’m hoping to get an upgrade to both of the blog sites that I upload to and the old rss feeds will most likely no longer be active.</content>
	</entry>
	<entry>
		<title>Snapshots of Index Contention</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/04/snapshots-of-index-contention.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-04:57a329d4-1844-41eb-ba3e-6c42384bdda2</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DM Views" />
		<updated>2009-05-05T05:51:33Z</updated>
		<published>2009-05-05T05:51:33Z</published>
		<content type="html">&lt;p&gt;&lt;img style="margin: 10px 0px 10px 10px; display: inline" align="right" src="http://alinems.com/images/summer_trfc.png" width="153" height="152" /&gt;&lt;/p&gt;  &lt;p&gt;Occasionally, I need to determine where index hotspots are located within databases.&amp;#160; To do this, I use the DMV &lt;a href="http://msdn.microsoft.com/en-us/library/ms174281.aspx" target="_blank"&gt;sys.dm_db_index_operational_stats&lt;/a&gt;.&amp;#160; I’ve talked about this DMV before while I was going through the &lt;a href="http://stratesql.com/2009/04/29/analyze-this-ndash-analyze-your-indexes-ndash-part-6.aspx" target="_blank"&gt;index analysis blogs posts&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;This DMV returns locking and blocking information for tables and indexes in the database.&amp;#160; This information is aggregated since the last time the SQL Server service was started or when the metadata cache for the index is reset.&amp;#160; Inactivity of an index or DDL operations are the types of a activities that can cause the metadata cache to be reset.&lt;/p&gt;  &lt;p&gt;Sometimes though index contention may not have occurred when you are currently knee deep in performance issues.&amp;#160; And as such, finding the hotspot at the time of the issue is more important that knowing that the contention happened at some point since the statistics were last reset.&amp;#160; &lt;strike&gt;So just go out and restart the SQL Server service because that’s makes it easy.&lt;/strike&gt;&lt;/p&gt;  &lt;p&gt;To get a snapshot of the index contention without forcing the metadata cache to reset, it is necessary to baseline the current state of contention and then compare it to a future state after a period of time has past.&amp;#160; In the script below, the query provides a 5 minute snapshot of index contention.&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @dbid INT;
 
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; @dbid=DB_ID();
 
&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @IndexOperationalStats table
    (
    database_id int
    ,object_id int
    ,index_id int
    ,partition_number int
    ,row_lock_count bigint
    ,row_lock_wait_count bigint
    ,row_lock_wait_in_ms bigint
    )

--INSERT INTO @IndexOperationalStats
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; database_id
    ,object_id
    ,index_id
    ,partition_number
    ,row_lock_count
    ,row_lock_wait_count
    ,row_lock_wait_in_ms
FROM sys.dm_db_index_operational_stats (@dbid, NULL, NULL, NULL) s
 
WAITFOR DELAY &lt;span style="color: #008000"&gt;'00:05:00.000'&lt;/span&gt;
 
;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; IndexOperationalStats_Delta
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; s.database_id
        ,s.object_id
        ,s.index_id
        ,s.partition_number
        ,s.row_lock_count - COALESCE(t.row_lock_count, 0) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; row_lock_count
        ,s.row_lock_wait_count - COALESCE(t.row_lock_wait_count, 0) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; row_lock_wait_count
        ,s.row_lock_wait_in_ms - COALESCE(t.row_lock_wait_in_ms, 0) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; row_lock_wait_in_ms
    FROM sys.dm_db_index_operational_stats (@dbid, NULL, NULL, NULL) s
        LEFT OUTER JOIN @IndexOperationalStats t 
            &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; s.database_id = t.database_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; s.object_id = t.object_id 
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; s.index_id = t.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; s.partition_number = t.partition_number
    WHERE OBJECTPROPERTY(s.OBJECT_ID,&lt;span style="color: #008000"&gt;'IsUserTable') = 1&lt;/span&gt;
)
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
    DB_NAME(database_id) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; DbName
    ,OBJECT_NAME(ios.[object_id]) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; ObjName
    ,i.name &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; IndexName
    ,i.index_id
    ,partition_number
    ,row_lock_count
    ,row_lock_wait_count 
    ,CAST (100.0 * row_lock_wait_count / (1 + row_lock_count) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; NUMERIC(15,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [block %]
    ,row_lock_wait_in_ms
    ,CAST (1.0 * row_lock_wait_in_ms / (1 + row_lock_wait_count) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; NUMERIC(15,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; [Avg Row Lock Waits (ms)]
FROM IndexOperationalStats_Delta ios
    INNER JOIN sys.indexes i &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; i.object_id = ios.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ios.index_id
ORDER BY row_lock_wait_count DESC&lt;/pre&gt;
&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>Sorting Project Files in SSMS</title>
		<link rel="alternate" href="http://stratesql.com/2009/05/04/sorting-project-files-in-ssms.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-05-04:e1eaf494-7e68-4ee5-87ba-54f58f01cc3c</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Tools and Tips" />
		<updated>2009-05-04T13:55:00Z</updated>
		<published>2009-05-04T13:55:00Z</published>
		<content type="html">&lt;p&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" align="right" src="http://cotor.00freeweb.com/assets/images/pancake_bunny_art.jpg" width="107" height="155" /&gt;Ever need to sort your project files for SSMS and SSIS?&amp;#160; I did.&amp;#160; So in case anyone could use this… and since I needed to use it again tonight… &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.sqldbatips.com/showarticle.asp?ID=78&amp;amp;reason=0"&gt;http://www.sqldbatips.com/showarticle.asp?ID=78&amp;amp;reason=0&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A good tool and easy to use.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Analyze This - Analyze Your Indexes &amp;ndash; Part 6</title>
		<link rel="alternate" href="http://stratesql.com/2009/04/29/analyze-this-ndash-analyze-your-indexes-ndash-part-6.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-04-29:c5d0ab30-92f7-4e26-9dd4-94268883be6b</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DM Views" />
		<updated>2009-04-29T13:00:00Z</updated>
		<published>2009-04-29T13:00:00Z</published>
		<content type="html">&lt;p&gt;This is the sixth and last &lt;strike&gt;for now&lt;/strike&gt; post in which I’m going through a query that can be used to analyze indexes.  Thus far the following has been added to the query:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Combine existing index statistics and missing indexes into a single output (&lt;a href="http://stratesql.com/2009/04/19/analyze-this-ndash-your-indexes-analysis-ndash-part-1.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Find existing duplicate and overlapping indexes (&lt;a href="http://stratesql.com/2009/04/20/analyze-this-ndash-analyze-your-indexes-ndash-part-2.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Find the relationship between indexes and foreign keys (&lt;a href="http://stratesql.com/2009/04/21/analyze-this-ndash-analyze-your-indexes-ndash-part-3.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Added size and current memory utilization (&lt;a href="http://stratesql.com/2009/04/23/analyze-this-ndash-analyze-your-indexes-ndash-part-4.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Add in index analysis guidelines (&lt;a href="http://stratesql.com/2009/04/28/analyze-this-ndash-analyze-your-indexes-ndash-part-5.aspx"&gt;blog&lt;/a&gt;)&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If you’ve used the last few versions of this query you may have noticed that performance against databases with a large number of indexes wasn’t all that great.  Also, the query didn’t account for partitions which I had planned to resolve at a later date.  Oh, look – it’s a later date.&lt;/p&gt;  &lt;p&gt;In the first few versions of the index analysis query, new features to the query were added through the use of CTEs.  The trouble with the way the query was put together was that it caused it to choke when performing as the volume of indexes being reviewed increased.  In a few sample executions, the performance has improved by an order of magnitude.  In one case the execution went from almost 3 minutes to 20 seconds.&lt;/p&gt;  &lt;p&gt;This version of the index analysis query also now works with SQL Server 2005 RTM.  There was a few functions being used that were added in SQL Server 2005 SP 2.  Those have been removed to allow for compatibility back to SQL Server 2005 RTM.&lt;/p&gt;  &lt;p&gt;A new column that flags whether of not a table has a unique index on it was added.  This was added based on a request in a comment a couple posts ago.&lt;/p&gt;  &lt;p&gt;Besides fixing the items listed above, there was a need to review indexes to check for blocking.  To do this the DMV &lt;a href="http://msdn.microsoft.com/en-us/library/ms174281.aspx" target="_blank"&gt;sys.dm_db_index_operational_stats&lt;/a&gt; should be used.  This DMV provides I/O, locking, latching, and access method activity for each partition of a table or index.  Only blocking statistics have been with the index analysis at this time.&lt;/p&gt;  &lt;p&gt;The last thing that could have been added to the query was fragmentation information from &lt;a href="http://msdn.microsoft.com/en-us/library/ms188917.aspx" target="_blank"&gt;ys.dm_db_index_physical_stats&lt;/a&gt;.  This was not included because the execution of this DMV is invasive even when using SIMPLE mode.&lt;/p&gt;  &lt;p&gt;The new version of the query is as follows:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @ObjectID int
    ,@DB_ID int

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @ObjectID = OBJECT_ID(&lt;span style="color: #008000"&gt;'')&lt;/span&gt;
    ,@DB_ID = db_id()

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #008000"&gt;'tempdb..#IndexBaseLine') IS NOT NULL&lt;/span&gt;
    DROP TABLE #IndexBaseLine

CREATE TABLE #IndexBaseLine
    (
    row_id int IDENTITY(1,1)
    ,index_action varchar(10)
    ,schema_id int
    ,schema_name sysname
    ,object_id int
    ,table_name sysname
    ,index_id int
    ,index_name nvarchar(128)
    ,is_unique bit &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt;(0)
    ,has_unique bit &lt;span style="color: #0000ff"&gt;DEFAULT&lt;/span&gt;(0)
    ,type_desc nvarchar(67)
    ,partition_number int
    ,reserved_page_count bigint
    ,size_in_mb &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12, 2)
    ,buffered_page_count int
    ,buffer_mb &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12, 2)
    ,pct_in_buffer &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12, 2)
    ,table_buffer_mb &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12, 2)
    ,row_count bigint
    ,impact int
    ,existing_ranking bigint
    ,user_total bigint
    ,user_total_pct &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(6, 2)
    ,estimated_user_total_pct &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(6, 2)
    ,user_seeks bigint
    ,user_scans bigint
    ,user_lookups bigint
    ,row_lock_count bigint
    ,row_lock_wait_count bigint
    ,row_lock_wait_in_ms bigint
    ,row_block_pct &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(6, 2)
    ,avg_row_lock_waits_ms bigint
    ,indexed_columns nvarchar(max)
    ,included_columns nvarchar(max)
    ,indexed_columns_compare nvarchar(max)
    ,included_columns_compare nvarchar(max)
    ,duplicate_indexes nvarchar(max)
    ,overlapping_indexes nvarchar(max)
    ,related_foreign_keys nvarchar(max)
    ,related_foreign_keys_xml xml
    )

&lt;span style="color: #0000ff"&gt;IF&lt;/span&gt; OBJECT_ID(&lt;span style="color: #008000"&gt;'tempdb..#ForeignKeys') IS NOT NULL&lt;/span&gt;
    DROP TABLE #ForeignKeys

CREATE TABLE #ForeignKeys
    (
    foreign_key_name sysname
    ,object_id int
    ,fk_columns nvarchar(max)
    ,fk_columns_compare nvarchar(max)
    )

;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; AllocationUnits
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; p.object_id
        ,p.index_id
        ,p.partition_number 
        ,au.allocation_unit_id
    FROM sys.allocation_units &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; au
        INNER JOIN sys.partitions &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; p &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (au.type = 1 &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; au.type = 3)
    UNION ALL
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; p.object_id
        ,p.index_id
        ,p.partition_number 
        ,au.allocation_unit_id
    FROM sys.allocation_units &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; au
        INNER JOIN sys.partitions &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; p &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.container_id = p.partition_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; au.type = 2
),MemoryBuffer
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; au.object_id
        ,au.index_id
        ,au.partition_number
        ,COUNT(*)&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; buffered_page_count
        ,CONVERT(&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2), CAST(COUNT(*) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; bigint)*CAST(8 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; float)/1024) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; buffer_mb
    FROM sys.dm_os_buffer_descriptors &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; bd 
        INNER JOIN AllocationUnits au &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; bd.allocation_unit_id = au.allocation_unit_id
    WHERE bd.database_id = db_id()
    GROUP BY au.object_id, au.index_id, au.partition_number
)
INSERT INTO #IndexBaseLine
    (schema_id, schema_name, object_id, table_name, index_id, index_name, is_unique, type_desc, partition_number, reserved_page_count, size_in_mb, buffered_page_count, buffer_mb, pct_in_buffer, row_count, existing_ranking, user_total, user_total_pct, user_seeks, user_scans, user_lookups, row_lock_count, row_lock_wait_count, row_lock_wait_in_ms, row_block_pct, avg_row_lock_waits_ms, indexed_columns, included_columns, indexed_columns_compare, included_columns_compare)
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; s.schema_id
    ,s.name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; schema_name
    ,t.object_id
    ,t.name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; table_name
    ,i.index_id
    ,COALESCE(i.name, &lt;span style="color: #008000"&gt;'N/A') as index_name&lt;/span&gt;
    ,i.is_unique
    ,&lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; i.is_unique = 1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #008000"&gt;'UNIQUE ' ELSE '' END + i.type_desc as type_desc&lt;/span&gt;
    ,ps.partition_number
    ,ps.reserved_page_count 
    ,CAST(reserved_page_count * CAST(8 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; float) / 1024 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; size_in_mb
    ,mb.buffered_page_count
    ,mb.buffer_mb
    ,CAST(100*buffer_mb/NULLIF(CAST(reserved_page_count * CAST(8 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; float) / 1024 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)),0) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; pct_in_buffer
    ,row_count
    ,ROW_NUMBER() 
        OVER (PARTITION BY i.object_id ORDER BY i.is_primary_key desc, ius.user_seeks + ius.user_scans + ius.user_lookups desc) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; existing_ranking
    ,ius.user_seeks + ius.user_scans + ius.user_lookups &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total
    ,COALESCE(CAST(100 * (ius.user_seeks + ius.user_scans + ius.user_lookups)
        /(NULLIF(SUM(ius.user_seeks + ius.user_scans + ius.user_lookups) 
        OVER(PARTITION BY i.object_id), 0) * 1.) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(6,2)),0) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total_pct
    ,ius.user_seeks
    ,ius.user_scans
    ,ius.user_lookups
    ,ios.row_lock_count 
    ,ios.row_lock_wait_count 
    ,ios.row_lock_wait_in_ms 
    ,CAST(100.0 * ios.row_lock_wait_count/NULLIF(ios.row_lock_count, 0) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; row_block_pct 
    ,CAST(1. * ios.row_lock_wait_in_ms /NULLIF(ios.row_lock_wait_count, 0) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; avg_row_lock_waits_ms 
    ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
            FROM sys.index_columns ic
                INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ic.object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ic.column_id = c.column_id
            WHERE i.object_id = ic.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 0
            ORDER BY key_ordinal ASC
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS indexed_columns&lt;/span&gt;
    ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
            FROM sys.index_columns ic
                INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ic.object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ic.column_id = c.column_id
            WHERE i.object_id = ic.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 1
            ORDER BY key_ordinal ASC
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS included_columns&lt;/span&gt;
    ,(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ic.column_id,&lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
            FROM sys.index_columns ic
            WHERE i.object_id = ic.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 0
            ORDER BY key_ordinal ASC
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')) AS indexed_columns_compare&lt;/span&gt;
    ,COALESCE((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ic.column_id, &lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
            FROM sys.index_columns ic
            WHERE i.object_id = ic.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 1
            ORDER BY key_ordinal ASC
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), SPACE(0)) AS included_columns_compare&lt;/span&gt;
FROM sys.tables t
    INNER JOIN sys.schemas s &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.schema_id = s.schema_id
    INNER JOIN sys.indexes i &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.object_id = i.object_id
    INNER JOIN sys.dm_db_partition_stats ps &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; i.object_id = ps.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ps.index_id
    LEFT OUTER JOIN sys.dm_db_index_usage_stats ius &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; i.object_id = ius.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ius.index_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ius.database_id = db_id()
    LEFT OUTER JOIN sys.dm_db_index_operational_stats(@DB_ID, NULL, NULL, NULL) ios &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ps.object_id = ios.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ps.index_id = ios.index_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ps.partition_number = ios.partition_number
    LEFT OUTER JOIN MemoryBuffer mb &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ps.object_id = mb.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ps.index_id = mb.index_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ps.partition_number = mb.partition_number
WHERE t.object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL

INSERT INTO #IndexBaseLine
    (schema_id, schema_name, object_id, table_name, index_name, type_desc, impact, existing_ranking, user_total, user_seeks, user_scans, user_lookups, indexed_columns, included_columns)
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; s.schema_id
    ,s.name &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; schema_name
    ,t.object_id
    ,t.name &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; table_name
    ,&lt;span style="color: #008000"&gt;'--MISSING--' AS index_name&lt;/span&gt;
    ,&lt;span style="color: #008000"&gt;'--NONCLUSTERED--' AS type_desc&lt;/span&gt;
    ,(migs.user_seeks + migs.user_scans) * migs.avg_user_impact &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; impact
    ,0 &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; existing_ranking
    ,migs.user_seeks + migs.user_scans &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total
    ,migs.user_seeks 
    ,migs.user_scans
    ,0 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_lookups
    ,COALESCE(equality_columns + &lt;span style="color: #008000"&gt;', ', SPACE(0)) + COALESCE(inequality_columns, SPACE(0)) as indexed_columns&lt;/span&gt;
    ,included_columns
FROM sys.tables t
    INNER JOIN sys.schemas s &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.schema_id = s.schema_id
    INNER JOIN sys.dm_db_missing_index_details mid &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.object_id = mid.object_id
    INNER JOIN sys.dm_db_missing_index_groups mig &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; mid.index_handle = mig.index_handle
    INNER JOIN sys.dm_db_missing_index_group_stats migs &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; mig.index_group_handle = migs.group_handle
WHERE mid.database_id = db_id()
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (mid.object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)

INSERT INTO #ForeignKeys
    (foreign_key_name, object_id, fk_columns, fk_columns_compare)
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; fk.name + &lt;span style="color: #008000"&gt;'|PARENT' AS foreign_key_name&lt;/span&gt;
    ,fkc.parent_object_id &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; object_id
    ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
            FROM sys.foreign_key_columns ifkc
                INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ifkc.parent_object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ifkc.parent_column_id = c.column_id
            WHERE fk.object_id = ifkc.constraint_object_id
            ORDER BY ifkc.constraint_column_id
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS fk_columns&lt;/span&gt;
    ,(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ifkc.parent_column_id,&lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
            FROM sys.foreign_key_columns ifkc
            WHERE fk.object_id = ifkc.constraint_object_id
            ORDER BY ifkc.constraint_column_id
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')) AS fk_columns_compare&lt;/span&gt;
FROM sys.foreign_keys fk
    INNER JOIN sys.foreign_key_columns fkc &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.object_id = fkc.constraint_object_id
WHERE fkc.constraint_column_id = 1
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (fkc.parent_object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)
UNION ALL
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; fk.name + &lt;span style="color: #008000"&gt;'|REFERENCED' as foreign_key_name&lt;/span&gt;
    ,fkc.referenced_object_id &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; object_id
    ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
            FROM sys.foreign_key_columns ifkc
                INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ifkc.referenced_object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ifkc.referenced_column_id = c.column_id
            WHERE fk.object_id = ifkc.constraint_object_id
            ORDER BY ifkc.constraint_column_id
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS fk_columns&lt;/span&gt;
    ,(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ifkc.referenced_column_id,&lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
            FROM sys.foreign_key_columns ifkc
            WHERE fk.object_id = ifkc.constraint_object_id
            ORDER BY ifkc.constraint_column_id
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')) AS fk_columns_compare&lt;/span&gt;
FROM sys.foreign_keys fk
    INNER JOIN sys.foreign_key_columns fkc &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.object_id = fkc.constraint_object_id
WHERE fkc.constraint_column_id = 1
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (fkc.referenced_object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)

UPDATE ibl
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; duplicate_indexes = STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + index_name AS [data()]&lt;/span&gt;
            FROM #IndexBaseLine iibl
            WHERE ibl.object_id = iibl.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.index_id &amp;lt;&gt; iibl.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.indexed_columns_compare = iibl.indexed_columns_compare
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.included_columns_compare = iibl.included_columns_compare
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '')&lt;/span&gt;
    ,overlapping_indexes = STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + index_name AS [data()]&lt;/span&gt;
            FROM #IndexBaseLine iibl
            WHERE ibl.object_id = iibl.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.index_id &amp;lt;&gt; iibl.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (ibl.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; iibl.indexed_columns_compare + &lt;span style="color: #008000"&gt;'%' &lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; iibl.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; ibl.indexed_columns_compare + &lt;span style="color: #008000"&gt;'%')&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.indexed_columns_compare &amp;lt;&gt; iibl.indexed_columns_compare 
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '')&lt;/span&gt;
    ,related_foreign_keys = STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + foreign_key_name AS [data()]&lt;/span&gt;
            FROM #ForeignKeys ifk
            WHERE ifk.object_id = ibl.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; ifk.fk_columns_compare + &lt;span style="color: #008000"&gt;'%'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '')&lt;/span&gt;
    ,related_foreign_keys_xml = CAST((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; foreign_key_name
            FROM #ForeignKeys ForeignKeys
            WHERE ForeignKeys.object_id = ibl.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ibl.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; ForeignKeys.fk_columns_compare + &lt;span style="color: #008000"&gt;'%'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML &lt;span style="color: #0000ff"&gt;AUTO&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; xml) 
FROM #IndexBaseLine ibl

INSERT INTO #IndexBaseLine
    (schema_id, schema_name, object_id, table_name, index_name, type_desc, existing_ranking, indexed_columns)
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; s.schema_id
    ,s.name &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; schema_name
    ,t.object_id
    ,t.name &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; table_name
    ,fk.foreign_key_name &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; index_name
    ,&lt;span style="color: #008000"&gt;'--MISSING FOREIGN KEY--' as type_desc&lt;/span&gt;
    ,9999
    ,fk.fk_columns
FROM sys.tables t
    INNER JOIN sys.schemas s &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.schema_id = s.schema_id
    INNER JOIN #ForeignKeys fk &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.object_id = fk.object_id
    LEFT OUTER JOIN #IndexBaseLine ia &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.object_id = ia.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ia.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; fk.fk_columns_compare + &lt;span style="color: #008000"&gt;'%'&lt;/span&gt;
WHERE ia.index_name &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL

;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; Aggregation
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; row_id
        ,CAST(100. * (user_seeks + user_scans + user_lookups)
            /(NULLIF(SUM(user_seeks + user_scans + user_lookups) 
            OVER(PARTITION BY schema_name, table_name), 0) * 1.) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; estimated_user_total_pct
        ,SUM(buffer_mb) OVER(PARTITION BY schema_name, table_name) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; table_buffer_mb
    FROM #IndexBaseLine 
)
UPDATE ibl
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; estimated_user_total_pct = COALESCE(a.estimated_user_total_pct, 0)
    ,table_buffer_mb = a.table_buffer_mb
FROM #IndexBaseLine ibl
    INNER JOIN Aggregation a &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ibl.row_id = a.row_id

;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; IndexAction
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; row_id
        ,&lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; user_lookups &gt; user_seeks &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; type_desc &lt;span style="color: #0000ff"&gt;IN&lt;/span&gt; (&lt;span style="color: #008000"&gt;'CLUSTERED', 'HEAP', 'UNIQUE CLUSTERED') THEN 'REALIGN'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; type_desc = &lt;span style="color: #008000"&gt;'--MISSING FOREIGN KEY--' THEN 'CREATE'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; type_desc = &lt;span style="color: #008000"&gt;'XML' THEN '---'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; is_unique = 1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #008000"&gt;'---'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; type_desc = &lt;span style="color: #008000"&gt;'--NONCLUSTERED--' AND ROW_NUMBER() OVER (PARTITION BY table_name ORDER BY user_total desc) &amp;lt;= 10 AND estimated_user_total_pct &gt; 1 THEN 'CREATE'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; type_desc = &lt;span style="color: #008000"&gt;'--NONCLUSTERED--' THEN 'BLEND'&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; ROW_NUMBER() OVER (PARTITION BY table_name ORDER BY user_total desc, existing_ranking) &gt; 10 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #008000"&gt;'DROP' &lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; user_total = 0 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #008000"&gt;'DROP' &lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;ELSE&lt;/span&gt; &lt;span style="color: #008000"&gt;'---' END AS index_action&lt;/span&gt;
    FROM #IndexBaseLine
)
UPDATE ibl
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; index_action = ia.index_action
FROM #IndexBaseLine ibl INNER JOIN IndexAction ia
&lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ibl.row_id = ia.row_id

UPDATE ibl
&lt;span style="color: #0000ff"&gt;SET&lt;/span&gt; has_unique = 1
FROM #IndexBaseLine ibl
    INNER JOIN (&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; DISTINCT object_id FROM sys.indexes i WHERE i.is_unique = 1) x &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ibl.object_id = x.object_id

&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
    index_action
    ,schema_name + &lt;span style="color: #008000"&gt;'.' + table_name as object_name&lt;/span&gt;
    ,index_name
    ,is_unique
    ,has_unique
    ,type_desc
    ,size_in_mb
    ,buffer_mb
    ,pct_in_buffer
    ,table_buffer_mb
    ,row_count
    ,user_total
    ,user_total_pct
    ,estimated_user_total_pct
    ,user_seeks
    ,user_scans
    ,user_lookups
    ,row_lock_count
    ,row_lock_wait_count
    ,row_lock_wait_in_ms
    ,row_block_pct
    ,avg_row_lock_waits_ms
    ,indexed_columns
    ,included_columns
    ,duplicate_indexes
    ,overlapping_indexes
    ,related_foreign_keys
    ,related_foreign_keys_xml 
FROM #IndexBaseLine
ORDER BY table_buffer_mb DESC, object_id, user_total DESC&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;b&gt;NOTE:&lt;/b&gt; &lt;i&gt;Populating the table name in the function for the @ObjectID variable is optional.  If the value of @ObjectID is NULL then information on all tables is returned.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;This version of the query populates the following columns:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;b&gt;row_id: &lt;/b&gt;Row identifier used for populating the table&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;index_action:&lt;/b&gt; Analysis recommendation on action to take on the index&lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;&lt;b&gt;CREATE:&lt;/b&gt; Recommend adding the index to the table.&lt;/li&gt;

    &lt;li&gt;&lt;b&gt;DROP:&lt;/b&gt; Recommend dropping the index from the table&lt;/li&gt;

    &lt;li&gt;&lt;b&gt;BLEND:&lt;/b&gt; Review the missing index details to see if the missing index details can be added to an existing index.&lt;/li&gt;

    &lt;li&gt;&lt;b&gt;REALIGN:&lt;/b&gt; Bookmark lookups on the index exceed the number of seeks on the table.  Recommend investigating whether to move the clustered index to another index or add included columns to the indexes that are part of the bookmark lookups.&lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;&lt;b&gt;schema_id: &lt;/b&gt;Schema ID&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;schema_name: &lt;/b&gt;Name of the &lt;b&gt;s&lt;/b&gt;chema.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;object_id: &lt;/b&gt;Object ID&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;table_name: &lt;/b&gt;Name of the &lt;b&gt;t&lt;/b&gt;able name&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;index_id: &lt;/b&gt;Index ID&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;index_name: &lt;/b&gt;Name of the &lt;b&gt;i&lt;/b&gt;ndex.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;is_unique: &lt;/b&gt;Flag indicating whether an index has a unique index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;has_unique: &lt;/b&gt;Flag indicating whether the table has a unique index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;type_desc:&lt;/b&gt; Type of index; either clustered or non-clustered.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;partition_number:&lt;/b&gt; Partition number.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;reserved_page_count:&lt;/b&gt; Total number of pages reserved for the index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;size_in_mb: &lt;/b&gt;The amount of space in MB the index utilizes on disk.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;buffered_page_count:&lt;/b&gt; Total number of pages in the buffer for the index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;buffer_mb: &lt;/b&gt;The amount of space in MB in the buffer for the index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;pct_in_buffer: &lt;/b&gt;The percentage of an index that is current in the SQL Server buffer.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;table_buffer_mb:&lt;/b&gt; The amount of space in MB in the SQL Server buffer that is being utilized by the table.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;row_count:&lt;/b&gt; Number of rows in the index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;impact:&lt;/b&gt; Calculation of impact of a potential index.  This is based on the seeks and scans that the index could have utilized multiplied by average improvement the index would have provided.  This is included only for missing indexes.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;existing_ranking: &lt;/b&gt;Ranking of the existing indexes ordered by user_total descending across the indexes for the table.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;user_total:&lt;/b&gt; Total number of seek, scan, and lookup operations for the index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;user_total_pct:&lt;/b&gt; Percentage of total number of seek, scan, and lookup operations for this index compared to all seek, scan, and lookup operations for existing indexes for the table.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;estimated_user_total_pct:&lt;/b&gt; Percentage of total number of seek, scan, and lookup operations for this index compared to all seek, scan, and lookup operations for existing and potential indexes for the table.  This number is naturally skewed because a seek for potential Index A resulted in another operation on an existing index and both of these operations would be counted.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;user_seeks: &lt;/b&gt;Number of seek operations on the index. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;user_scans: &lt;/b&gt;Number of scan operations on the index. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;user_lookups: &lt;/b&gt;Number of lookup operations on the index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;row_lock_count: &lt;/b&gt;Cumulative number of row locks requested. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;row_lock_wait_count: &lt;/b&gt;Cumulative number of times the Database Engine waited on a row lock. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;row_lock_wait_in_ms: &lt;/b&gt;Total number of milliseconds the Database Engine waited on a row lock.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;row_block_pct: &lt;/b&gt;Percentage of row locks that encounter waits on a row lock.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;avg_row_lock_waits_ms: &lt;/b&gt;Average number of milliseconds the Database Engine waited on a row lock.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;indexed_columns: &lt;/b&gt;Columns that are part of the index, missing index or foreign key. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;included_columns: &lt;/b&gt;Columns that are included in the index or missing index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;indexed_columns_compare:&lt;/b&gt; Column IDs that are part of the index, missing index or foreign key&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;included_columns_compare:&lt;/b&gt; Column IDs that are included in the index or missing index.&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;duplicate_indexes: &lt;/b&gt;List of Indexes that exist on the table that are identical to the index on this row. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;overlapping_indexes: &lt;/b&gt;List of Indexes that exist on the table that overlap the index on this row. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;related_foreign_keys: &lt;/b&gt;List of foreign keys that are related to the index either as an exact match or covering index. &lt;/li&gt;

  &lt;li&gt;&lt;b&gt;related_foreign_keys_xml: &lt;/b&gt;XML document listing foreign keys that are related to the index either as an exact match or covering index.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I mentioned in a previous post, when looking at the index_action column don’t take a literal translation of the recommendation.  These are put together from my personal experience and used as a pointer towards a direction versus a specific directive.&lt;/p&gt;

&lt;p&gt;Hopefully breaking apart the index analysis query into multiple posts has helped people grasp why each piece was added and learn a little bit more about the underlying DMVs and catalog views used to put this together.&lt;/p&gt;

&lt;p&gt;In future posts some examples will be put together to look at how to take snapshots of indexes with this query.  And also to take the recommendations and implement them to improve the indexing on databases.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;EDIT May 18, 2009: &lt;/b&gt;Fixed error in aggregating type 2 
sys.partition data.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Beta Exam 71-680: TS: Windows 7, Configuring</title>
		<link rel="alternate" href="http://stratesql.com/2009/04/28/beta-exam-71680-ts-windows-7-configuring.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-04-28:8679a3f0-06a4-43c9-8ddb-e1a735b79773</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="Certification" />
		<category term="Windows 7" />
		<updated>2009-04-28T13:09:00Z</updated>
		<published>2009-04-28T13:09:00Z</published>
		<content type="html">&lt;p&gt;Microsoft has announced that the &lt;a href="http://blogs.technet.com/betaexams/archive/2009/04/15/register-for-beta-exam-71-680-ts-windows-7-configuring.aspx"&gt;Beta exam for 71-680: TS: Windows 7, Configuring&lt;/a&gt; has been opened up.&amp;#160; Beta exams are free to take are if you are planning to take the exam at a later date, now is as good a time as any… well a little studying first might help.&lt;/p&gt;  &lt;p&gt;It doesn’t appear that the outline for the exam is up on Microsoft Learning yet, but you can get a lot of information from the &lt;a href="http://www.microsoft.com/learning/windows-7/default.mspx"&gt;Windows 7 - Learning Portal&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The beta exam is open through May 18th and I really recommend taking it to help vet out the exam and… well, it’s free.&amp;#160; Be sure to be as wordy as possible in the exam comment section the people that work on the exam put a lot of time into reading comments and adjusting the exams around those comments.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Analyze This &amp;ndash; Analyze Your Indexes &amp;ndash; Part 5</title>
		<link rel="alternate" href="http://stratesql.com/2009/04/28/analyze-this-ndash-analyze-your-indexes-ndash-part-5.aspx?ref=rss" />
		<id>tag:stratesql.com,2009-04-28:c97704ab-52a6-451f-a271-29344b787c1c</id>
		<author>
			<name>Jason Strate</name>
		</author>
		<category term="SQLServer" />
		<category term="SQL 2008" />
		<category term="SQL Tips" />
		<category term="SQL 2005" />
		<category term="Performance Tuning" />
		<category term="DM Views" />
		<updated>2009-04-28T13:00:00Z</updated>
		<published>2009-04-28T13:00:00Z</published>
		<content type="html">&lt;p&gt;This is the fifth post in which I am walking through a query that I use to analyze indexes.&amp;#160; Thus far I have added to the following to the query that I use:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Combine existing index statistics and missing indexes into a single output (&lt;a href="http://stratesql.com/2009/04/19/analyze-this-ndash-your-indexes-analysis-ndash-part-1.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Find existing duplicate and overlapping indexes (&lt;a href="http://stratesql.com/2009/04/20/analyze-this-ndash-analyze-your-indexes-ndash-part-2.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Find the relationship between indexes and foreign keys (&lt;a href="http://stratesql.com/2009/04/21/analyze-this-ndash-analyze-your-indexes-ndash-part-3.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Added size and current memory utilization (&lt;a href="http://stratesql.com/2009/04/23/analyze-this-ndash-analyze-your-indexes-ndash-part-4.aspx"&gt;blog&lt;/a&gt;) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;While testing the current version of the index analysis query I found an issue with the foreign key portion of the filtering that has been fixed.&amp;#160; Where the code was:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;WHERE fkc.constraint_column_id = 1
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (fkc.parent_object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;It should have been:&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;WHERE fkc.constraint_column_id = 1
&lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (fkc.referenced_object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For the next version of the index analysis query I wanted to build in some guidance on how to handle indexes on the table.&amp;#160; There is a couple things I wanted to be able to tell at a glance without much thought.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;When could clustered indexes be realigned on a table to improve performance on a table.&amp;#160; This idea came about after reading &lt;a href="http://www.mssqltips.com/tip.asp?tip=1642"&gt;this article&lt;/a&gt; on &lt;a href="http://www.mssqltips.com"&gt;MSSQLTips&lt;/a&gt;.&amp;#160; The logic used evaluates user_lookups against user_seeks.&lt;/li&gt;

  &lt;li&gt;When the index count exceed 10 indexes on the table flag the indexes to be dropped.&amp;#160; At some point, I read an index best practices the provided guidance around 5-10 indexes per table in OLTP environments.&amp;#160; If anyone has a link to an article on this please let me know, the one I read I lost track of.&lt;/li&gt;

  &lt;li&gt;Any indexes that could be built for foreign keys should be flagged to be created.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This information is found in a new columns called &lt;strong&gt;index_action&lt;/strong&gt;.&amp;#160; The new version of the query is as follows:&lt;/p&gt;

&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;DECLARE&lt;/span&gt; @ObjectID int
&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; @ObjectID = OBJECT_ID(&lt;span style="color: #008000"&gt;'')&lt;/span&gt;

;&lt;span style="color: #0000ff"&gt;WITH&lt;/span&gt; IndexSize
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt;(
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; object_id
        ,index_id
        ,CAST((SUM(reserved_page_count) * CAST(8 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; float))/1024 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; size_in_mb
    FROM sys.dm_db_partition_stats
    GROUP BY object_id, index_id
)
,preIndexAnalysis
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
        OBJECT_SCHEMA_NAME(t.object_id) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; schema_name
        ,t.name &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; table_name
        ,COALESCE(i.name, &lt;span style="color: #008000"&gt;'N/A') as index_name&lt;/span&gt;
        ,i.is_unique
        ,&lt;span style="color: #0000ff"&gt;CASE&lt;/span&gt; &lt;span style="color: #0000ff"&gt;WHEN&lt;/span&gt; i.is_unique = 1 &lt;span style="color: #0000ff"&gt;THEN&lt;/span&gt; &lt;span style="color: #008000"&gt;'UNIQUE ' ELSE '' END + i.type_desc as type_desc&lt;/span&gt;
        ,iz.size_in_mb
        ,NULL &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; impact
        ,ROW_NUMBER() 
            OVER (PARTITION BY i.object_id ORDER BY i.is_primary_key desc, ius.user_seeks + ius.user_scans + ius.user_lookups desc) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; ranking
        ,ius.user_seeks + ius.user_scans + ius.user_lookups &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total
        ,COALESCE(CAST(100 * (ius.user_seeks + ius.user_scans + ius.user_lookups)
            /(NULLIF(SUM(ius.user_seeks + ius.user_scans + ius.user_lookups) 
            OVER(PARTITION BY i.object_id), 0) * 1.) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(6,2)),0) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total_pct
        ,ius.user_seeks
        ,ius.user_scans
        ,ius.user_lookups
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
                FROM sys.index_columns ic
                    INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ic.object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ic.column_id = c.column_id
                WHERE i.object_id = ic.object_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 0
                ORDER BY key_ordinal ASC
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS indexed_columns&lt;/span&gt;
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
                FROM sys.index_columns ic
                    INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ic.object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ic.column_id = c.column_id
                WHERE i.object_id = ic.object_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 1
                ORDER BY key_ordinal ASC
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS included_columns&lt;/span&gt;
        ,i.object_id
        ,i.index_id
        ,(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ic.column_id,&lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
                FROM sys.index_columns ic
                WHERE i.object_id = ic.object_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 0
                ORDER BY key_ordinal ASC
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')) AS indexed_columns_compare&lt;/span&gt;
        ,COALESCE((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ic.column_id, &lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
                FROM sys.index_columns ic
                WHERE i.object_id = ic.object_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ic.index_id
                &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; is_included_column = 1
                ORDER BY key_ordinal ASC
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), SPACE(0)) AS included_columns_compare&lt;/span&gt;
    FROM sys.tables t
        INNER JOIN sys.indexes i &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; t.object_id = i.object_id
        LEFT OUTER JOIN sys.dm_db_index_usage_stats ius &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; i.object_id = ius.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = ius.index_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ius.database_id = db_id()
        INNER JOIN IndexSize iz &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; i.object_id = iz.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; i.index_id = iz.index_id
    WHERE t.object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL
    UNION ALL
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
        OBJECT_SCHEMA_NAME(mid.object_id) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; schema_name
        ,OBJECT_NAME(mid.object_id) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; table_name
        ,&lt;span style="color: #008000"&gt;'--MISSING--'&lt;/span&gt;
        ,NULL
        ,&lt;span style="color: #008000"&gt;'--NONCLUSTERED--'&lt;/span&gt;
        ,NULL
        ,(migs.user_seeks + migs.user_scans) * migs.avg_user_impact &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; impact
        ,0 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; ranking
        ,migs.user_seeks + migs.user_scans &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total
        ,NULL &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_total_pct
        ,migs.user_seeks 
        ,migs.user_scans
        ,0 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; user_lookups
        ,COALESCE(equality_columns + &lt;span style="color: #008000"&gt;', ', SPACE(0)) + COALESCE(inequality_columns, SPACE(0)) as indexed_columns&lt;/span&gt;
        ,included_columns
        ,mid.object_id
        ,NULL
        ,NULL
        ,NULL
    FROM sys.dm_db_missing_index_details mid
        INNER JOIN sys.dm_db_missing_index_groups mig &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; mid.index_handle = mig.index_handle
        INNER JOIN sys.dm_db_missing_index_group_stats migs &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; mig.index_group_handle = migs.group_handle
    WHERE database_id = db_id()
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (mid.object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)
)
,ForeignKeys
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; fk.name + &lt;span style="color: #008000"&gt;'|PARENT' AS name&lt;/span&gt;
        ,fkc.parent_object_id &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; object_id
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
                FROM sys.foreign_key_columns ifkc
                    INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ifkc.parent_object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ifkc.parent_column_id = c.column_id
                WHERE fk.object_id = ifkc.constraint_object_id
                ORDER BY ifkc.constraint_column_id
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS fk_columns&lt;/span&gt;
        ,(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ifkc.parent_column_id,&lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
                FROM sys.foreign_key_columns ifkc
                WHERE fk.object_id = ifkc.constraint_object_id
                ORDER BY ifkc.constraint_column_id
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')) AS fk_columns_compare&lt;/span&gt;
    FROM sys.foreign_keys fk
        INNER JOIN sys.foreign_key_columns fkc &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.object_id = fkc.constraint_object_id
    WHERE fkc.constraint_column_id = 1
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (fkc.parent_object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)
    UNION ALL
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; fk.name + &lt;span style="color: #008000"&gt;'|REFERENCED' as name&lt;/span&gt;
        ,fkc.referenced_object_id &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; object_id
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + QUOTENAME(c.name)&lt;/span&gt;
                FROM sys.foreign_key_columns ifkc
                    INNER JOIN sys.columns c &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; ifkc.referenced_object_id = c.object_id &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ifkc.referenced_column_id = c.column_id
                WHERE fk.object_id = ifkc.constraint_object_id
                ORDER BY ifkc.constraint_column_id
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS fk_columns&lt;/span&gt;
        ,(&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; QUOTENAME(ifkc.referenced_column_id,&lt;span style="color: #008000"&gt;'(')&lt;/span&gt;
                FROM sys.foreign_key_columns ifkc
                WHERE fk.object_id = ifkc.constraint_object_id
                ORDER BY ifkc.constraint_column_id
                &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')) AS fk_columns_compare&lt;/span&gt;
    FROM sys.foreign_keys fk
        INNER JOIN sys.foreign_key_columns fkc &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; fk.object_id = fkc.constraint_object_id
    WHERE fkc.constraint_column_id = 1
    &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (fkc.referenced_object_id = @ObjectID &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; @ObjectID &lt;span style="color: #0000ff"&gt;IS&lt;/span&gt; NULL)
)
,MemoryBuffer
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; 
        obj.object_id
        ,obj.index_id
        ,COUNT(*)&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; Buffered_Page_Count
        ,CONVERT(&lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(12,2), CAST(COUNT(*) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; bigint)*CAST(8 &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; float)/1024) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; buffer_mb
    FROM sys.dm_os_buffer_descriptors &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; bd 
        INNER JOIN 
        (
            &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; object_name(object_id) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; name 
                ,index_id ,allocation_unit_id, object_id
            FROM sys.allocation_units &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; au
                INNER JOIN sys.partitions &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; p 
                    &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id 
                        &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (au.type = 1 &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; au.type = 3)
            UNION ALL
            &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; object_name(object_id) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; name   
                ,index_id, allocation_unit_id, object_id
            FROM sys.allocation_units &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; au
                INNER JOIN sys.partitions &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; p 
                    &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; au.container_id = p.hobt_id 
                        &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; au.type = 2
        ) &lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; obj &lt;span style="color: #0000ff"&gt;ON&lt;/span&gt; bd.allocation_unit_id = obj.allocation_unit_id
    WHERE database_id = db_id()
    GROUP BY obj.object_id ,obj.index_id
)
, IndexAnalysis
&lt;span style="color: #0000ff"&gt;AS&lt;/span&gt; (
    &lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; ia.object_id
        ,ia.index_id
        ,schema_name
        ,table_name
        ,index_name
        ,is_unique
        ,type_desc
        ,size_in_mb
        ,impact
        ,ranking
        ,user_total
        ,user_total_pct
        ,CAST(100 * (user_seeks + user_scans + user_lookups)
            /(NULLIF(SUM(user_seeks + user_scans + user_lookups) 
            OVER(PARTITION BY schema_name, table_name), 0) * 1.) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt;(6,2)) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; estimated_percent
        ,user_seeks
        ,user_scans
        ,user_lookups
        ,indexed_columns
        ,included_columns
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + index_name AS [data()]&lt;/span&gt;
            FROM preIndexAnalysis iia
            WHERE ia.object_id = iia.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ia.index_id &amp;lt;&amp;gt; iia.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ia.indexed_columns_compare = iia.indexed_columns_compare
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ia.included_columns_compare = iia.included_columns_compare
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS duplicate_indexes&lt;/span&gt;
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + index_name AS [data()]&lt;/span&gt;
            FROM preIndexAnalysis iia
            WHERE ia.object_id = iia.object_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ia.index_id &amp;lt;&amp;gt; iia.index_id
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; (ia.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; iia.indexed_columns_compare + &lt;span style="color: #008000"&gt;'%' &lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;OR&lt;/span&gt; iia.indexed_columns_compare &lt;span style="color: #0000ff"&gt;LIKE&lt;/span&gt; ia.indexed_columns_compare + &lt;span style="color: #008000"&gt;'%')&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;AND&lt;/span&gt; ia.indexed_columns_compare &amp;lt;&amp;gt; iia.indexed_columns_compare 
            &lt;span style="color: #0000ff"&gt;FOR&lt;/span&gt; XML PATH(&lt;span style="color: #008000"&gt;'')), 1, 2, '') AS overlapping_indexes&lt;/span&gt;
        ,STUFF((&lt;span style="color: #0000ff"&gt;SELECT&lt;/span&gt; &lt;span style="color: #008000"&gt;', ' + name AS [data()]&lt;/span&gt;
            FROM ForeignKeys ifk
            WHERE ifk.object_id = ia.object_id
     