<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
  <channel>
    <title>Kimberly L. Tripp</title>
    <description>Improving *my* SQL skills through your questions!</description>
    <link>http://www.sqlskills.com/BLOGS/KIMBERLY/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.sqlskills.com/BLOGS/KIMBERLY/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.sqlskills.com/</blogChannel:blink>
    <dc:creator>Kimberly L. Tripp</dc:creator>
    <dc:title>Kimberly L. Tripp</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/KimberlyLTripp" type="application/rss+xml" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">KimberlyLTripp</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Filtered indexes and filtered stats might become seriously out-of-date</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;Time flies when you&amp;#39;re having fun, eh? This week Paul and I are in Dublin, Ireland delivering a deep technical &amp;quot;SQL Immersion Event&amp;quot; on Internals, Performance Tuning and Maintenance&amp;nbsp;with our partner &lt;a href="http://www.prodata.ie/" target="_blank"&gt;ProData&lt;/a&gt;&amp;nbsp;(and having a blast - we have a really fun and very interactive group). And, today&amp;#39;s an even more interesting day to be in Dublin as it&amp;#39;s the &lt;/font&gt;&lt;a href="http://www.prweb.com/releases/2009/09/prweb2929344.htm" target="_blank"&gt;&lt;font size="2"&gt;250th anniversary of the Guinness Brewery&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;...everyone around Dublin will be toasting the most popular drink in Ireland today (Sept 24) at 5:59pm GMT. Unfortunately, our class runs until 6pm but Paul tells me that we&amp;#39;re still going to celebrate. ;-) &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For now, we&amp;#39;ll just have to celebrate some SQL (I can hear minor grumblings everywhere :)... &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Filtered indexes and filtered stats are an incredibly powerful feature in SQL Server 2008 - one that I&amp;#39;ve posted on before and will again. Today&amp;#39;s post is about some of the gotchas with filtered index stats and filtered stats. Cutting to the punchline - you might have some trouble with their accuracy as your data changes. The SIMPLE solution is to update these specific stats manually and more frequently (meaning that you don&amp;#39;t want to rely on the database option AUTO_UPDATE_STATISTICS). In fact, depending on your data volatility, you might want to update these statistics on a VERY frequent basis. Part of the question you&amp;#39;ll have to answer is how much of the filtered set changes over the course of a day/week/month. And, in whatever frequency you reach 5-10% (let&amp;#39;s say weekly), I&amp;#39;d suggest updating the statistics weekly. If you update 5-10% within the course of a day - then daily. Let me give you the full story... &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;Statistics are traditionally updated when roughly 20% (+ a minimum of 500 rows) of the data has changed. If you have a table with 100,000 rows then SQL Server will hit the threshold at 20,500 rows (just a tad over 20%) and a table with 10,000 rows will hit the threshold at 2,500 rows (which is 25%). Additionally,&amp;nbsp;in SQL Server 200x (2000, 2005 and 2008) statistics are NOT immediately updated when the threshold is reached, instead they are invalidated. It&amp;#39;s not until someone needs the statistic that SQL Server updates it. This reduces thrashing that occurred in SQL Server 7.0 when stats were updated immediately instead of just being invalidated. Another interesting point is what is meant by &amp;quot;20% of the data has changed?&amp;quot;... How is that defined? Is it based on updates to columns or inserts of rows? Of course the answer is... it depends - here, it depends on the version of SQL Server that you&amp;#39;re using:&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font size="2"&gt;SQL Server 2000 defines 20% as 20% of the ROWS have changed. You can see this in sysindexes.rcmodctr.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font size="2"&gt;SQL Server 2005/8 defines 20% as 20% of the COLUMN data has changed. You cannot see this unless you are accessing SQL Server through the DAC as it&amp;#39;s in a base system table (2005: sysrowsetcolumns.rcmodified and for &lt;/font&gt;2008: &lt;font size="2"&gt;sysrscols.rcmodified).&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Now, for regular indexes (&lt;em&gt;those that do not include a filter&lt;/em&gt;) both strategies have pros and cons. Let&amp;#39;s start with the con for SQL 2000... If you have a particularly volatile column then the rowmodctr will be increased quickly and then ALL statistics (&lt;em&gt;even those that have not changed&lt;/em&gt;) are invalidated. Without a way to understand a &lt;strong&gt;&lt;u&gt;column&lt;/u&gt;&lt;/strong&gt;&amp;#39;s volatility, you will invalidate some statistics too soon. So, 2005/2008 created a column modification counter to better define when a statistic should be invalidated. But, the con for SQL 2005/2008 (which is the pro for row-based algorithm of SQL 2000) is that a lot more data must change in a single column before the statistics get updated. If your modifications are fairly well balanced (across the table) then the row-based algorithm could suit you better. If your modifications are isolated (to a specific column) then the column-based algorithm will suit you better. But, neither is perfect... and, the new column-based algorithm poses another HUGE problem for filtered indexes.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;For filtered indexes the threshold invalidation algorithm is tied SOLELY to the column and not just to the filtered set. So, if your table has 10,000 rows it takes 2,500 modifications in that column to update statistics. If your filtered index only has 1,000 rows... then you could theoretically modify this specific filtered set 2.5 times before IT would be updated. Yes, I realized that this sounds unlikely but it&amp;#39;s really not. What if your filter is for ACTIVE = 1. It&amp;#39;s only 1% of your table and it&amp;#39;s the most active data set. You will effectively have to modify this set 20 times over before the statistics for your filtered index get updated.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;But, having said that - I also have a simple solution. Don&amp;#39;t wait... For filtered indexes (especially on volatile data) add a special UPDATE STATISTICS job that specifically updates their stats with a FULLSCAN. The good news is that they are likely to be smaller indexes (and therefore easier/less-costly statistics to update) and you&amp;#39;ll clearly get a lot better uses out of them. Additional good news is that many filtered indexes are designed to be covering indexes, covering indexes aren&amp;#39;t going to rely as heavily on statistics so there are many covered queries that won&amp;#39;t care. The following query will get the list of all of your tables/indexes that have filters. Once you have this list you can create a loop to update statistics.&lt;/font&gt; 
&lt;/p&gt;
&lt;font size="5" color="#0000ff"&gt;&lt;font size="5" color="#0000ff"&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;SELECT &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_name&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Table Name]&lt;br /&gt;
	&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/font&gt;&lt;/font&gt; name &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Index Name]&lt;br /&gt;
	&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;stats_date&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; stats_id&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Last Updated]&lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;stats&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE &lt;/font&gt;&lt;/font&gt;has_filter &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;=&lt;/font&gt;&lt;/font&gt; 1&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;
&lt;font size="2"&gt;So, there are lots of options and&amp;nbsp;definitely a few things&amp;nbsp;of which to be aware... filtered indexes&amp;nbsp;and filtered stats are a powerful option&amp;nbsp;to leverage, just make sure you keep those stats up to date!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Cheers... it&amp;#39;s time for a pint of Guinness!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;kt &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;PS - For more information on statistics, check out the SQL Server whitepapers:&lt;/font&gt; 
&lt;/p&gt;
&lt;font size="2"&gt;&lt;font size="1"&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd535534.aspx" target="_blank"&gt;&lt;font size="2"&gt;Statistics Used by the Query Optimizer in Microsoft SQL Server 2008&lt;/font&gt;&lt;/a&gt;&amp;nbsp;&lt;font size="2"&gt;(added this after comment #2, please review ALL of the comments as there&amp;#39;s a good discussion on the 2008 filtered stats &amp;quot;multiplier&amp;quot; and whether or not it&amp;#39;s having the desired effect?! I say no and want to reiterate - filtered index stats need more frequent updating based on your data volatility.)&lt;/font&gt;&lt;/li&gt;&lt;font size="2"&gt;&lt;font size="1"&gt;
	&lt;li&gt;&lt;font size="2"&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/sql/2005/qrystats.mspx" target="_blank"&gt;Statistics Used by the Query Optimizer in Microsoft SQL Server 2005&lt;/a&gt;&lt;/font&gt;&lt;/li&gt;&lt;/font&gt;&lt;/font&gt;
	&lt;li&gt;&lt;font size="2"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx" target="_blank"&gt;Statistics Used by the Query Optimizer in Microsoft SQL Server 2000&lt;/a&gt;&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/font&gt;&lt;/font&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=wAOGNUkgZ3U:eXI2jxsRRBA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=wAOGNUkgZ3U:eXI2jxsRRBA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=wAOGNUkgZ3U:eXI2jxsRRBA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=wAOGNUkgZ3U:eXI2jxsRRBA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=wAOGNUkgZ3U:eXI2jxsRRBA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Filtered-indexes-and-filtered-stats-might-become-seriously-out-of-date.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Filtered-indexes-and-filtered-stats-might-become-seriously-out-of-date.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=92044df1-6f06-4d1e-8b0c-d3e991d4ec72</guid>
      <pubDate>Thu, 24 Sep 2009 09:45:00 -0800</pubDate>
      <category>Filtered Indexes</category>
      <category>Indexes</category>
      <category>Inside the storage engine</category>
      <category>SQL Server 2008</category>
      <category>Statistics</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=92044df1-6f06-4d1e-8b0c-d3e991d4ec72</pingback:target>
      <slash:comments>13</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=92044df1-6f06-4d1e-8b0c-d3e991d4ec72</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Filtered-indexes-and-filtered-stats-might-become-seriously-out-of-date.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=92044df1-6f06-4d1e-8b0c-d3e991d4ec72</wfw:commentRss>
    </item>
    <item>
      <title>The fall line-up and event list - we hope to see you there!</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;We&amp;#39;ve finally booked all of our tickets and started planning final details for all our of our classes and conferences this fall. We&amp;#39;ve got quite a few things planned and tons of great content at each. By continent, here&amp;#39;s the plan: &lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva"&gt;&lt;font size="3"&gt;&lt;strong&gt;Europe&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Dublin, Ireland: &lt;/strong&gt;September 21-25.&amp;nbsp;Paul and I&amp;nbsp;will be teaching a week-long Immersion Event&amp;nbsp;- combining internals, performance tuning, database maintenance and more.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Warsaw, Poland: &lt;/strong&gt;September 29-30. Paul and I will be presenting a full day of SQL Server sessions at the Microsoft Technology Summit 2009&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;font size="3"&gt;Australia - Melbourne&lt;/font&gt;&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;October 15-16. Paul and I will be teaching a 2-day class &amp;quot;SQL Server 2008: New Features - Updating Your Administrations Skills in Database Infrastructure and Scalability&amp;quot; &lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;October 19-22. Paul will be teaching a 4-day class &amp;quot;SQL Server 2005/2008: DB Maintenance and Availability: From Performance to Disaster Recovery&amp;quot;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;October 19-22. I will be teaching a 4-day class &amp;quot;SQL Server 2005/2008: Performance Tuning &amp;ndash; From Design to Indexing to Optimizing Procedural Code&amp;quot;&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	&lt;strong&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font size="3"&gt;US&lt;/font&gt; &lt;/font&gt;&lt;/strong&gt;
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Seattle, WA &lt;/strong&gt;for SQLPASS: November 2-5. Paul and I will be teaching two full-day workshops and a Spotlight Session each.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Las Vegas, NV &lt;/strong&gt;for SQL Connections: Nobember 9-12: Paul and&amp;nbsp;I will&amp;nbsp;be teaching two full-day workshops and 5 sessions. Stacia will be teaching 4 sessions on BI.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;strong&gt;Redmond, WA &lt;/strong&gt;for SQL MCMs and Sharepoint MCM&amp;#39;s through the end of this year&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;You can find more details and links to the various registration sites on our &lt;/font&gt;&lt;a href="http://www.sqlskills.com/upcomingConferences.asp"&gt;&lt;font face="verdana,geneva" size="2"&gt;Upcoming Events&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; page. And, if you have any questions, feel free to email me: Kimberly AT SQLskills.com or Paul AT SQLskills.com. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;We hope to see you there and be sure to swing by and say hi! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Cheers,&lt;br /&gt;
kt &lt;/font&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=gyz5hprvG6Q:pkh_Rifl4y4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=gyz5hprvG6Q:pkh_Rifl4y4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=gyz5hprvG6Q:pkh_Rifl4y4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=gyz5hprvG6Q:pkh_Rifl4y4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=gyz5hprvG6Q:pkh_Rifl4y4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-fall-line-up-and-event-list-we-hope-to-see-you-there!.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-fall-line-up-and-event-list-we-hope-to-see-you-there!.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=d9b1a308-4cfd-4e59-9617-32ea0578eb86</guid>
      <pubDate>Mon, 24 Aug 2009 17:35:00 -0800</pubDate>
      <category>Conferences</category>
      <category>Events</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=d9b1a308-4cfd-4e59-9617-32ea0578eb86</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=d9b1a308-4cfd-4e59-9617-32ea0578eb86</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-fall-line-up-and-event-list-we-hope-to-see-you-there!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=d9b1a308-4cfd-4e59-9617-32ea0578eb86</wfw:commentRss>
    </item>
    <item>
      <title>Column order doesn't matter... generally, but - IT DEPENDS!</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;OK, for years I&amp;#39;ve been saying that SQL Server doesn&amp;#39;t care about the order in which you define the columns of your table because internally SQL Server will re-arrange your columns to store all of the fixed width columns first and the variable columns last. In both the fixed-width portion of the row as well as the variable-width portion of the row, the columns are defined in the order in which they are declared. So, what does matter?&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;It&amp;#39;s all in the cost of the variable array&amp;#39;s offset values. If the large majority of your NULLable records are at the end, then SQL Server doesn&amp;#39;t need to completely populate the variable block array (which saves 2 bytes per column). If you have a table where 36 columns are NULLable and generally they are NULL, then defining those columns at the end of the row can save you space.&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The following script will show you how the maximum length of the row changes based on whether or not a later column in the variable block is NOT NULL - even when most/all of the prior columns are!&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&lt;font size="3"&gt;&lt;font face="courier new,courier"&gt;CREATE&lt;/font&gt;&lt;font face="courier new,courier"&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;TABLE&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier" size="3"&gt; RowSizeVariableBlock&lt;br /&gt;
	&lt;/font&gt;&lt;font size="3"&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;ID &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NOT&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;identity&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c01 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;char&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;10&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NOT&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;default&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;test&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c02 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;datetime2&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;7&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NOT&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;default&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;sysdatetime&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;(),&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c03 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;char&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;80&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NOT&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;default&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;junk&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c04 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c05 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c06 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c07 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c08 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c09 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c10 &lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;c11 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c12 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c13 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c14 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c15 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c16 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c17 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c18 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c19 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c20 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c21 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c22 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c23 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c24 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c25 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c26 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c27 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c28 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c29 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c30 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c31 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c32 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c33 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c34 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c35 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c36 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c37 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c38 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c39 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;c40 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;varchar&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;100&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;br /&gt;
	)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;insert&lt;/font&gt;&lt;/font&gt; RowSizeVariableBlock &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;DEFAULT&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;VALUES&lt;br /&gt;
	go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier" size="3"&gt; RowSizeVariableBlock &lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt; &lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;dm_db_index_physical_stats&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;db_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(),&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;RowSizeVariableBlock&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;detailed&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" size="3" color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;-- review &amp;quot;max&amp;quot; record size = 114&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;insert&lt;/font&gt;&lt;/font&gt; RowSizeVariableBlock&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;c01&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; c03&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; c20&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;values &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;med row&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;up to c20&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;test&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier" size="3"&gt; RowSizeVariableBlock &lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt; &lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;dm_db_index_physical_stats&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;db_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(),&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;RowSizeVariableBlock&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;detailed&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" size="3" color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;-- review &amp;quot;max&amp;quot; record size = 154&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;insert&lt;/font&gt;&lt;/font&gt; RowSizeVariableBlock&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;c01&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; c03&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; c30&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;values &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;med+ row&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;up to c30&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;test&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier" size="3"&gt; RowSizeVariableBlock &lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt; &lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;dm_db_index_physical_stats&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;db_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(),&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;RowSizeVariableBlock&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;detailed&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font face="courier new,courier" size="3" color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;-- review &amp;quot;max&amp;quot; record size = 174&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;insert&lt;/font&gt;&lt;/font&gt; RowSizeVariableBlock&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;c01&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; c03&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; c40&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;values &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;large row&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;up to c40&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;test&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier" size="3"&gt; RowSizeVariableBlock &lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;select&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;from&lt;/font&gt;&lt;/font&gt; &lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="courier new,courier"&gt;&lt;font size="3"&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;dm_db_index_physical_stats&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;db_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(),&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;RowSizeVariableBlock&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;),&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;null,&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;detailed&amp;#39;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="3"&gt;&lt;font face="courier new,courier"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;font color="#008000"&gt;-- review &amp;quot;max&amp;quot; record size = 194&lt;/font&gt;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;go&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva"&gt;&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt;While there are some other optimizations at this level, &lt;/span&gt;&lt;strong&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt;most&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt; tables cannot benefit from this as the data populations aren&amp;#39;t as predictable nor are most tables filled with so many variable-width and NULLable columns.&amp;nbsp;However, if you do have this data pattern, defining these columns at the end of your table&amp;#39;s definition - MIGHT save a tremendous amount of space, especially when this table is very large!&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt;&lt;/span&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 12pt"&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt;&lt;font face="verdana,geneva"&gt;Paul&amp;#39;s blogged more on these structures as well as the NULL bitmap here: &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-null-bitmap-size.aspx"&gt;&lt;font face="verdana,geneva"&gt;http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-null-bitmap-size.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva"&gt;. &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: 'Verdana','sans-serif'; font-size: 12pt"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="+0"&gt;&lt;font size="3"&gt;&lt;font size="+0"&gt;&lt;font size="2"&gt;
	&lt;p&gt;
	&lt;font face="trebuchet ms,geneva"&gt;&lt;span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 10pt"&gt;&lt;font face="verdana,geneva" color="#000000"&gt;Enjoy! And, thanks for reading,&lt;br /&gt;
	kt&lt;/font&gt;&lt;/span&gt; &lt;/font&gt;
	&lt;/p&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/blockquote&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=3dyMzlMY2bQ:XJiFkNOGeg0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=3dyMzlMY2bQ:XJiFkNOGeg0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=3dyMzlMY2bQ:XJiFkNOGeg0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=3dyMzlMY2bQ:XJiFkNOGeg0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=3dyMzlMY2bQ:XJiFkNOGeg0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Column-order-doesnt-matter-generally-but-IT-DEPENDS!.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Column-order-doesnt-matter-generally-but-IT-DEPENDS!.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=bd865bc4-9dcd-45e5-88aa-cd5b016c836e</guid>
      <pubDate>Mon, 10 Aug 2009 07:10:00 -0800</pubDate>
      <category>Design</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <category>Inside the storage engine</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=bd865bc4-9dcd-45e5-88aa-cd5b016c836e</pingback:target>
      <slash:comments>14</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=bd865bc4-9dcd-45e5-88aa-cd5b016c836e</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Column-order-doesnt-matter-generally-but-IT-DEPENDS!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=bd865bc4-9dcd-45e5-88aa-cd5b016c836e</wfw:commentRss>
    </item>
    <item>
      <title>Public SQL Server Immersion Event in Dublin in September</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Paul and I will be teaching a week-long public Immersion Event in Dublin, September 21-25, in partnership with our good friends at &lt;/font&gt;&lt;a href="http://www.prodata.ie/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Prodata&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;and Microsoft Ireland.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The class will cover:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Day 1: SQL Server Internals (On-disk structures, index internals, logging, recovery, transaction log architecture)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Day 2: Designing for Performance (data types, table and index partitioning)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Day 3: Indexing for Performance (Access patterns, covering, INCLUDE, indexing strategies)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Day 4: Essential Database Maintenance (data and log files, tempdb, index and statistics maintenance, backup and restore)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Day 5.1: Essential Database Maintenance (consistency checking and disaster recovery)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Day 5.2: SQL Consolidation and Virtualization&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is going to be a great workshop where we combine the best of all our various classes into a superb learning opportunity.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Checkout the &lt;a href="https://www.eventznet.com/295/ac/prodata/sie09/default.aspx"&gt;registration site&lt;/a&gt; for more in-depth details about the content, location, and cost.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Hope to see you there!&lt;/font&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=kItYtdq4E78:mw6WBQxPagY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=kItYtdq4E78:mw6WBQxPagY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=kItYtdq4E78:mw6WBQxPagY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=kItYtdq4E78:mw6WBQxPagY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=kItYtdq4E78:mw6WBQxPagY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Public-SQL-Server-Immersion-Event-in-Dublin-in-September.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (Admin)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Public-SQL-Server-Immersion-Event-in-Dublin-in-September.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2732dc1c-011d-4b0e-a0bb-911d3d3751a7</guid>
      <pubDate>Fri, 10 Jul 2009 15:58:00 -0800</pubDate>
      <dc:publisher>Admin</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2732dc1c-011d-4b0e-a0bb-911d3d3751a7</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=2732dc1c-011d-4b0e-a0bb-911d3d3751a7</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Public-SQL-Server-Immersion-Event-in-Dublin-in-September.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=2732dc1c-011d-4b0e-a0bb-911d3d3751a7</wfw:commentRss>
    </item>
    <item>
      <title>Looking for security vulnerabilities in database code</title>
      <description>&lt;p&gt;
I&amp;#39;ve always been concerned with security and I&amp;#39;ve always stressed the importance of auditing the REAL user context not just the current user (see &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/EXECUTE-AS-and-an-important-update-your-DDL-Triggers-(for-auditing-or-prevention).aspx" target="_blank"&gt;this post&lt;/a&gt; on EXECUTE AS and auditing). So, I generally try to avoid using dynamic string execution and if necessary create well tested/protected parameters (fyi - using QUOTENAME can be a fantasic solution to protectng identifiers as input parameters but it can&amp;#39;t protect more complex strings). 
&lt;/p&gt;
&lt;p&gt;
Having said that, what if I&amp;#39;m looking at a database for the first time... just poking around trying to see if there&amp;#39;s anything that needs further attention? I&amp;#39;ve come up with a quick query... And, while it&amp;#39;s not going to &amp;quot;solve&amp;quot; your problem (as that&amp;#39;s going to take some re-writing of code) or even &lt;em&gt;truly &lt;/em&gt;verify if you&amp;#39;re vulnerable, it gives you a &amp;quot;quick list&amp;quot;&amp;nbsp;of where you should look first! If&amp;nbsp;your code uses dynamic strings AND it&amp;#39;s elevated - then&amp;nbsp;start there!&amp;nbsp; 
&lt;/p&gt;
&lt;font size="5" color="#0000ff"&gt;&lt;font size="5" color="#0000ff"&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;SELECT &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;OBJECT_NAME&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;object_id&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Procedure Name]&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font size="2" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; CASE&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; WHEN&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXEC (%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;OR&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXEC(%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;THEN&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;WARNING: code contains EXEC&amp;#39;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXECUTE (%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;OR&lt;/font&gt;&lt;/font&gt; sm&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;definition&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;LIKE&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;%EXECUTE(%&amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;THEN&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;WARNING: code contains EXECUTE&amp;#39;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; END&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Dynamic Strings]&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font size="2" color="#808080"&gt;,&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; CASE&lt;br /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHEN&lt;/font&gt;&lt;/font&gt; execute_as_principal_id &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;IS&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NOT&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;NULL&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;THEN&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;N&amp;#39;WARNING: EXECUTE AS &amp;#39;&lt;/font&gt;&lt;/font&gt; &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;+&lt;/font&gt;&lt;/font&gt; &lt;font color="#ff00ff"&gt;&lt;font color="#ff00ff"&gt;user_name&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;execute_as_principal_id&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;)&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;&amp;#39;Code to run as caller - check connection context&amp;#39;&lt;br /&gt;
	&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp; END&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; [Execution Context Status]&lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt; &lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sys&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000"&gt;&lt;font color="#008000"&gt;sql_modules&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;AS&lt;/font&gt;&lt;/font&gt; sm&lt;br /&gt;
	&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;ORDER&lt;/font&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;BY&lt;/font&gt;&lt;/font&gt; [Procedure Name] &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;
Is this enough? Anything else you&amp;#39;d check? What do you think? 
&lt;/p&gt;
&lt;p&gt;
THANKS!&lt;br /&gt;
kt 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:KU-hbEMK438:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:KU-hbEMK438:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:KU-hbEMK438:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=MBr6YHzP20E:KU-hbEMK438:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=MBr6YHzP20E:KU-hbEMK438:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</guid>
      <pubDate>Tue, 30 Jun 2009 08:34:00 -0800</pubDate>
      <category>Security</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</pingback:target>
      <slash:comments>23</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Looking-for-security-vulnerabilities-in-database-code.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=2a2a7de6-c0d5-4b2f-856b-f4df09a91447</wfw:commentRss>
    </item>
    <item>
      <title>The Tipping Point Query Answers</title>
      <description>&lt;p&gt;
&lt;font size="2"&gt;OK, I&amp;#39;ll definitely take a beating from all of you for having gone so long between my survey posts and now. I won&amp;#39;t even go into the details but between some crazy work schedules, multiple sinus problems and even migraines... well, I&amp;#39;ve been a bit behind. Let&amp;#39;s just say that April/May were rough at best. I&amp;#39;m feeling better and well, now I&amp;#39;m trying to catch up. I had really gotten the blogging bug in March but I completely lost it in April. But, this tipping point series is in dire need of lots of explaining so I&amp;#39;m really hoping to get a few posts done in this area for sure! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;First, I started the discussion around this in a few surveys: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;Survey/Question 1&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q1 was described as this: if a table has 1 million rows at 20 rows per page (50,000 pages), at what percentage (roughly) of the data would a nonclustered index no longer be used. Blogged &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Why-arent-those-nonclustered-indexes-being-used.aspx" target="_blank"&gt;here&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt;. Here&amp;#39;s what the survey said as of today: &lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f6%2fTippingPointQuery1Survey.jpg" alt="" /&gt;&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;And, for Q1 the&amp;nbsp;correct result (&lt;strong&gt;Between 0-2% of the rows&lt;/strong&gt;) is actually the best result (but, by no means the overwhelming majority at only 28%). However, often people just &amp;quot;think&amp;quot; the answer is very small. So... I did a few more questions/surveys.&amp;nbsp;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;Survey/Question 2&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q2 was described as this: if a table has 1 million rows at&amp;nbsp;100 rows per page (10,000 pages), at what percentage (roughly) of the data would a nonclustered index no longer be used. Blogged &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Tipping-Point-Queries-More-Questions-To-Really-Test-You!.aspx" target="_blank"&gt;here&lt;/a&gt;&lt;font size="2"&gt;. Here&amp;#39;s what the survey said as of today: &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f6%2fTippingPointQuery2Survey.jpg" alt="" /&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;And, for Q2 the&amp;nbsp;correct result (&lt;strong&gt;Less than .5% of the rows&lt;/strong&gt;) is actually at a tie for the best (but, again, even a small percentage at only 22%). Again, often people just &amp;quot;think&amp;quot; the answer is very small. So... I did one more question/survey.&amp;nbsp;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;Survey/Question 3&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q3 was described as this: if a table has 1 million rows at&amp;nbsp;2 rows per page (500,000 pages), at what percentage (roughly) of the data would a nonclustered index no longer be used. Blogged &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Tipping-Point-Queries-More-Questions-To-Really-Test-You!.aspx" target="_blank"&gt;here&lt;/a&gt;&lt;font size="2"&gt;. Here&amp;#39;s what the survey said as of today: &lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;p&gt;
	&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f6%2fTippingPointQuery3Survey.jpg" alt="" /&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;And, for Q3 the&amp;nbsp;correct result (&lt;strong&gt;Between 10-20% of the rows&lt;/strong&gt;) is actually NOT the highest answer. And, this is even more convincing that there&amp;#39;s confusion around what&amp;#39;s going on and why.&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="3"&gt;&lt;strong&gt;The Tipping Point&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;&lt;strong&gt;What is the tipping point? &lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;It&amp;#39;s the point where the number of rows returned is &amp;quot;no longer selective enough&amp;quot;. SQL Server chooses NOT to use the nonclustered index to look up the corresponding data rows and instead performs a table scan. &lt;/font&gt;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;When does the tipping point occur?&lt;/font&gt; &lt;/strong&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;It depends... it&amp;#39;s MOSTLY tied to the number of pages in the table. Generally, around 30% of the number of PAGES in the table is about where the tipping point occurs. However, parallelism, some server settings (processor affinity and I/O affinity), memory and table size - all can have an impact. And, since it can vary - I typically estimate somewhere between 25% and 33% as a &lt;strong&gt;&lt;u&gt;rough&lt;/u&gt;&lt;em&gt; &lt;/em&gt;&lt;/strong&gt;tipping point (and, you&amp;#39;ll see from a bunch of my examples, that number is not EXACT). Then, I translate that into rows.&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;strong&gt;Math for Tipping Point Query 3:&lt;/strong&gt; If a table has 500,000 pages then 25% = 125,000 and 33% = 166,000. So, somewhere between 125,000 and 166,000 ROWS the query will tip. Turning that into a percentage 125,000/1million = 12.5% and 166,000/1million = 16.6%. So, if a table has 500,000 pages (and 1 million rows) then queries that return less than 12.5% of the data are likely to USE the nonclustered index to lookup the data and queries over 16.6% of the data are LIKELY to use a table scan. For this table, that percentage seems &amp;quot;reasonable&amp;quot;. But, most of us say that the tipping point happens at a much lower percentage... why? Because&amp;nbsp;row size - which&amp;nbsp;determines table size (and therefore pages) is really what has the greatest impact. So, let&amp;#39;s look at Tipping&amp;nbsp;Point Query 2...&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;strong&gt;Math for Tipping Point Query 2:&lt;/strong&gt; If a table has 10,000 pages then 25% = 2,500 and 33% = 3,333. So, somewhere between 2,500 and&amp;nbsp;3,333 ROWS the query will tip. Turning that into a percentage 2,500/1million = .25% and 3,333/1million = .33% (not even 1%). So, if a table has only 10,000 pages (and 1 million rows) then queries that return less than a quarter of 1% of the data are likely to USE the nonclustered index to lookup the data and queries over one third of one percent are LIKELY to use a table scan. For this table, that percentage seems really low BUT, at the same time it makes sense (to a point) that a small table would be scanned... but, for less than 1%. 1% is NOT selective enough.&amp;nbsp;For small tables, it might not matter all that much&amp;nbsp;(they&amp;#39;re small, they fit in cache, etc.) but for bigger tables - it might be a big performance problem.&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;strong&gt;Math for Tipping Point Query 1:&lt;/strong&gt; If a table has 50,000 pages then 25% = 12,500 and 33% = 16,666. So, somewhere between 12,500 and&amp;nbsp;16,666 ROWS the query will tip. Turning that into a percentage 12,500/1million = 1.25% and 16,666/1million = 1.66% (under 2%). So, if a table has 50,000 pages (and 1 million rows) then queries that return less than 1.25% of the data are likely to USE the nonclustered index to lookup the data and queries over 1.66% are LIKELY to use a table scan. Again, this seems like a low number. Again, for small tables, it might not matter all that much&amp;nbsp;(they&amp;#39;re small, they fit in cache, etc.) but as tables get larger and larger - it CAN be a big performance problem.&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;Why is the tipping point interesting?&lt;/font&gt; &lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;It shows that narrow (non-covering) nonclustered indexes have fewer uses than often expected (just because a query has a column in the WHERE clause doesn&amp;#39;t mean that SQL Server&amp;#39;s going to use that index) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;It happens at a point that&amp;#39;s typically MUCH earlier than expected... and, in fact, sometimes this is a VERY bad thing! &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Only nonclustered indexes that do not cover a query have a tipping point. Covering indexes don&amp;#39;t have this same issue (which further proves why they&amp;#39;re so important for performance tuning) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;You might find larger tables/queries performing table scans when in fact, it might be better to use a nonclustered index. How do you know, how do you test, how do you hint and/or force... and, is that a good thing?&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font size="2"&gt;&lt;strong&gt;Real example of an interesting tipping point&lt;/strong&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Earlier today, I went on facebook and twitter and gave the following information - very vaguely - and I asked &amp;quot;why&amp;quot; is Q2 so much slower than Q1 if Q2 returns only 10 more rows. Same table and&amp;nbsp;no hints (other than MAXDOP)...&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;Q1: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&amp;nbsp;table &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597420 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;) &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
	&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;returns 197,419 rows&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;takes 116,031 ms (1 minute, 52 seconds)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;1,197,700 logical reads, &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;5 physical reads, 137,861 read-ahead reads&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;7,562 ms CPU time&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;p&gt;
		&lt;font size="2"&gt;Q2: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;table &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597430 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
		&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;font size="2"&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;returns 197,4&lt;u&gt;2&lt;/u&gt;9 rows&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;takes&amp;nbsp;244,094 ms (4 minutes,&amp;nbsp;4 seconds)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;801,685&amp;nbsp;logical reads,&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;1410 physical reads,&amp;nbsp;801,678 read-ahead reads&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
		&lt;li&gt;&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;9,188&amp;nbsp;ms CPU time&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;p&gt;
	There were lots of great guesses... but, it&amp;#39;s the tipping point. SQL Server chose to &amp;quot;tip&amp;quot; the second query because it was &amp;quot;over the line&amp;quot;. But, it&amp;#39;s important to realize that there are cases when that&amp;#39;s NOT a good idea. And, what are your options? 
	&lt;/p&gt;
	&lt;p&gt;
	In SQL Server 2005 - the only option is to force the nonclustered index to be used: 
	&lt;/p&gt;
	&lt;blockquote&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;Q2: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;table WITH (INDEX (NCInd)) &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597430 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2" color="#000000"&gt;But, this can be TERRIBLY bad on some machines where the IOs could be a lot faster (and where data might already be in cache). These &lt;strong&gt;&lt;em&gt;specific &lt;/em&gt;&lt;/strong&gt;numbers are exactly that - specific to this HARDWARE (and, I chose not-so-optimal HW in this case to highlight this problem). And, depending on what number you use (what if this is a parameter in sps?) you might force SQL Server to do WAY more IOs by forcing the index than allowing the tipping point to do its job. But, depending on your hardware (and/or what you know to be in cache at the time of execution), it might be better to force an index instead of letting SQL Server choose. So, should I force the index? Be careful, if you&amp;#39;re wrong - it could take more time and actually be slower.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
	&lt;/blockquote&gt;
	&lt;p&gt;
	In SQL Server 2008 - there&amp;#39;s a new hint - FORCESEEK: 
	&lt;/p&gt;
	&lt;blockquote&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;Q2: &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;SELECT &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;*&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;FROM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;table WITH (INDEX (FORCESEEK)) &lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt;&lt;/font&gt;&amp;nbsp;colx &lt;font color="#808080"&gt;&lt;font color="#808080"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt; 597430 &lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;OPTION &lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&lt;font color="#808080"&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;MAXDOP&lt;/font&gt;&lt;/font&gt; 1&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
		&lt;/p&gt;
		&lt;p&gt;
		&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2" color="#000000"&gt;FORCESEEK is better because it doesn&amp;#39;t tie you to a particular index directly but it also doesn&amp;#39;t let SQL Server tip to a table scan. However, just like forcing an index - you can be wrong! &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
		&lt;/p&gt;
	&lt;/blockquote&gt;
	&lt;p&gt;
	&lt;font size="2"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="3" color="#808080"&gt;&lt;font size="2" color="#000000"&gt;So, what should you do? It depends. If you know your data well and you do some extensive testing you &lt;em&gt;might&lt;/em&gt; consider using a hint (there are some clever things you can do programmatically in sps, I&amp;#39;ll try and dedicate a post to this soon). However, a much better choice (if at all possible) is to consider covering (that&amp;#39;s really my main point :). In my queries, covering is unrealistic because my queries want all columns (the evil SELECT *) but, if your queries are narrower AND they are high-priority, you are better off with a covering index (in many cases) over a hint because an index which covers a query, never tips.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	That&amp;#39;s the answer to the puzzle for now but there&amp;#39;s definitely a lot more to dive into. The Tipping Point can be a very good thing - and it usually works well. But, if you&amp;#39;re finding that you can force an index and get better performance you might want to do some investigating and see if it&amp;#39;s this. Then consider how likely a hint is to help and now you know where you can focus. 
	&lt;/p&gt;
	&lt;p&gt;
	Thanks for reading,&lt;br /&gt;
	kt 
	&lt;/p&gt;
	&lt;/font&gt;
&lt;/blockquote&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:CMSU3CgsOJQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:CMSU3CgsOJQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:CMSU3CgsOJQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=40uim85_UTY:CMSU3CgsOJQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=40uim85_UTY:CMSU3CgsOJQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=47d66a60-99de-49b0-b50f-be4f26c88f0b</guid>
      <pubDate>Sun, 07 Jun 2009 21:29:00 -0800</pubDate>
      <category>Nonclustered Indexes</category>
      <category>SQL Server 2005</category>
      <category>SQL Server 2008</category>
      <category>The Tipping Point</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=47d66a60-99de-49b0-b50f-be4f26c88f0b</pingback:target>
      <slash:comments>43</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=47d66a60-99de-49b0-b50f-be4f26c88f0b</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/The-Tipping-Point-Query-Answers.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=47d66a60-99de-49b0-b50f-be4f26c88f0b</wfw:commentRss>
    </item>
    <item>
      <title>Favorite SSMS Options - and some gotchas</title>
      <description>&lt;p&gt;
&lt;font size="2"&gt;Whenever I setup a new machine, I like to set a few default options in SSMS. Here are my favorites:&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;Tools, Options&lt;/font&gt;&lt;/strong&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Environment&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;Fonts and Colors&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Text Editor font: Lucida Console (&lt;em&gt;a bit thicker and it&amp;#39;s a fixed-width font&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Text Editor: Selected Text (under display items)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Item foreground: Black&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Item background: Yellow (looks like a highlighter)&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Sometimes I&amp;#39;ll also make the results windows have larger fonts - especially if it&amp;#39;s a presentation machine&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;Keyboard&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Keyboard scheme: SQL Server 2000 (&lt;em&gt;ok, maybe&amp;nbsp;I&amp;#39;m old-school but the QA keyboard shortcuts still&amp;nbsp;seem a lot more natural than the VS keyboard shortcuts... but, if you&amp;#39;re more of a VS person, then&amp;nbsp;stick with Standard&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Query shortcuts:&lt;/font&gt; 
			&lt;/div&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Ctrl+F1: &lt;/font&gt;&lt;a href="http://www.sqlskills.com/blogs/Kimberly/post/Updates-(fixes)-to-sp_helpindex2.aspx" target="_blank"&gt;&lt;font size="2"&gt;sp_helpindex2&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&amp;nbsp;(&lt;em&gt;if you highlight an object and then hit Ctrl+F1, then it passes the highlighted object in as a parameter. The only negative is that it doesn&amp;#39;t delimit it so you can&amp;#39;t highlight schema.object unless it&amp;#39;s already quoted for the sp &amp;#39;schema.object&amp;#39;&lt;/em&gt;)&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="+0"&gt;&lt;font size="2"&gt;Ctrl+3: &lt;font face="courier new,courier"&gt;SELECT object_name(object_id) AS ObjName, * FROM sys.dm_db_index_physical_stats(db_id(), NULL, NULL, NULL, NULL) ORDER BY 1, 4 &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
				&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Ctrl+4: other common queries/procedures...&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Text Editor&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;All Languages &lt;/font&gt;
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Line numbers &lt;/font&gt;
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;Editor Tab and Status Bar - I usually change the colors of the &amp;quot;Group connections&amp;quot; setting to something very noticeable like Fuschia. I&amp;#39;ve already blogged why &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/SQL-Server-2008-Central-Management-Servers-have-you-seen-these.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/font&gt; 
		&lt;/div&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Query Execution&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;By default, open new queries in SQLCMD mode (&lt;em&gt;however, if you set this - you will disable Intellisense and Transact-SQL Debugging... and, there&amp;#39;s no &amp;quot;hint&amp;quot; or warning that you&amp;#39;re doing it.&lt;/em&gt;)&lt;/font&gt; 
		&lt;/div&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font size="2"&gt;Query Results&lt;/font&gt; 
	&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;SQL Server, Results to Grid&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Include the query in the result set (&lt;em&gt;this will show you what you executed in the results window while you wait for completion... also confirms what you think you executed. This gets annoying for large batches but is sometimes useful to see what you last executed&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Include column headers when copying or saving the results (&lt;em&gt;VERY useful if you&amp;#39;re pushing data over to Excel, etc.&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;Display results in a separate tab (&lt;em&gt;this gives you Tabbed mode instead of split-window mode meaning that results will go to a results Tab instead of the lower half of your window. I prefer this when I have a lot of results to review AND when I&amp;#39;m presenting and typically run with a lower screen res.&lt;/em&gt;)&lt;/font&gt; 
			&lt;/div&gt;
			&lt;ul&gt;
				&lt;li&gt;
				&lt;div&gt;
				&lt;font size="2"&gt;Switch to results tab after the query executes (I prefer this so that I&amp;#39;m waiting for the results in the results window)&lt;/font&gt; 
				&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;
		&lt;div&gt;
		&lt;font size="2"&gt;SQL Server, Results to Text&lt;/font&gt; 
		&lt;/div&gt;
		&lt;ul&gt;
			&lt;li&gt;
			&lt;div&gt;
			&lt;font size="2"&gt;I set most of the same settings as Results to Grid (Include column headers, Include the query, Display results in separate tab and Switch to the results tab) BUT, I usually turn off Scroll results as received. If I&amp;#39;m looking at rows at the top of the set (while it&amp;#39;s still processing) it often takes my cursor down to the end. I also turn this off in Profiler.&lt;/font&gt; 
			&lt;/div&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font size="2"&gt;The primary reason for this post though - is to make sure that you realize that one specific option - Tools, Options, Query Execution, &amp;quot;By default, open new queries in SQLCMD mode&amp;quot; - can really surprise you. I used to think that this option was really helpful (and benign) because SQLCMD is a superset of Transact-SQL. So, I typically recommended that you turn it on. However, turning on this option disables Intellisense and the Transact-SQL Debugger. It&amp;#39;s documented here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms174187.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms174187.aspx&lt;/a&gt;&amp;nbsp;(thanks Paul Mestemaker! :) and I thought this was a bit unintuitive at first but it really does make sense. Both the Transact-SQL Debugger and Intellisense are debugging and/or prompting you with Transact-SQL (not SQLCMD commands). So, disabling it seems right (well, I guess I could argue that it could work with Intellisense but debugging would be much harder). However, I just wish there were some better information in the Tools/Options dialog. I&amp;#39;d like my 2 hours back (trying to figure out which option disabled Intellisense, chatting with my friends on fb to see if they knew, filing a connect bug when I figured out that it was SQLCMD, and then learning from Paul Mest that it&amp;#39;s actually expected behavior (duh!), changing the Connect bug to say that the dialog might be better with a warning... it was definitely one of those mornings!&amp;nbsp;&amp;nbsp;:) :) :)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;So, my main point for this post - save you the time I lost in trying to figure out where Intellisense went. It&amp;#39;s expected behavior (and it does make sense........now :).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Cheers,&lt;br /&gt;
kt&lt;/font&gt; 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:C9G7qy6t5fs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:C9G7qy6t5fs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:C9G7qy6t5fs:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=6lQido_yIeo:C9G7qy6t5fs:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=6lQido_yIeo:C9G7qy6t5fs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Favorite-SSMS-Options-and-some-gotchas.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Favorite-SSMS-Options-and-some-gotchas.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=bd638d4c-b219-410e-96a6-ad732474bd44</guid>
      <pubDate>Sat, 06 Jun 2009 20:03:00 -0800</pubDate>
      <category>Manageability</category>
      <category>Tools</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=bd638d4c-b219-410e-96a6-ad732474bd44</pingback:target>
      <slash:comments>79</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=bd638d4c-b219-410e-96a6-ad732474bd44</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Favorite-SSMS-Options-and-some-gotchas.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=bd638d4c-b219-410e-96a6-ad732474bd44</wfw:commentRss>
    </item>
    <item>
      <title>SSMS Error possibly related to database compatibility mode</title>
      <description>&lt;p&gt;
&lt;font size="2"&gt;I&amp;#39;ve seen (and heard of a few other cases where people received) the following error:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;strong&gt;&lt;font face="courier new,courier" size="3"&gt;Index (zero based) must be greater than or equal to zero and less than the size of the argument list.&lt;/font&gt;&lt;/strong&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font size="2"&gt;And, the problem (when I got this error) was the compatibility mode of the database I was in didn&amp;#39;t support what was being attempted. In SQL Server 2005, the reports used to generate an &amp;quot;&lt;font face="courier new,courier"&gt;&lt;strong&gt;&lt;font&gt;Incorrect syntax near &amp;#39;(&amp;#39;.&lt;/font&gt;&amp;quot;&lt;/strong&gt;&lt;/font&gt; error. For what I was trying to do (execute/access some of the standard reports from within SQL Server &lt;strong&gt;200&lt;u&gt;8&lt;/u&gt;&lt;/strong&gt; Management Studio), I received this error and immediately thought it might be the compat mode. Sure enough, it was.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;So, I don&amp;#39;t know how often this will help you but just in case - I thought I&amp;#39;d post this!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Cheers,&lt;br /&gt;
kt&lt;/font&gt; 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:QOPMM1HaP2I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:QOPMM1HaP2I:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:QOPMM1HaP2I:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=2Vakh4AMj34:QOPMM1HaP2I:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=2Vakh4AMj34:QOPMM1HaP2I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/SSMS-Error-possibly-related-to-database-compatibility-mode.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/SSMS-Error-possibly-related-to-database-compatibility-mode.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=860ee84a-c0bc-4538-a670-8095457801ce</guid>
      <pubDate>Thu, 07 May 2009 09:55:00 -0800</pubDate>
      <category>SQL Server 2008</category>
      <category>Standard Reports</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=860ee84a-c0bc-4538-a670-8095457801ce</pingback:target>
      <slash:comments>79</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=860ee84a-c0bc-4538-a670-8095457801ce</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/SSMS-Error-possibly-related-to-database-compatibility-mode.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=860ee84a-c0bc-4538-a670-8095457801ce</wfw:commentRss>
    </item>
    <item>
      <title>Social networking, keeping up with friends/family and getting more tech info!</title>
      <description>&lt;p&gt;
OK, I know I don&amp;#39;t blog all that often but when I do, I do try and post as much useful information as I can :). I&amp;#39;ve got a few posts in the queue and a few more tests to do and code to write before I can wrap them up. In the interim, Paul and I have both decided to throw a bit of our &amp;quot;spare time&amp;quot; to keeping up with friends and family more and just staying &amp;quot;more connected.&amp;quot; In that effort, we&amp;#39;ve both joined facebook and twitter (&lt;a href="http://www.twitter.com/KimberlyLTripp"&gt;www.twitter.com/KimberlyLTripp&lt;/a&gt;&amp;nbsp;and &lt;a href="http://www.twitter.com/PaulRandal"&gt;www.twitter.com/PaulRandal&lt;/a&gt;). Our end goal is: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;strong&gt;Blogging&lt;/strong&gt;: large/complex posts with detailed info/code, etc. 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;strong&gt;Twitter&lt;/strong&gt;: short, quick posts on things to check out, review, etc. Maybe I&amp;#39;ll do a weekly summary of tweets that I do and/or followed? &lt;strong&gt;&lt;em&gt;Would you be interested in that?&lt;/em&gt;&lt;/strong&gt; And, as for my interface, I&amp;#39;m currently using TweetDeck and Twitter.com and I&amp;#39;ve also joined via WeFollow.com: #sqlserver, #mvp and #womenintech. 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;strong&gt;Facebook&lt;/strong&gt;: more fun stuff and keeping up with friends, etc. I have to admit that I really love the interface and I&amp;#39;m constantly impressed at how easy it is to upload video, photos, etc... It&amp;#39;s just NOT what I expected before I tried it out. I&amp;#39;d truly recommend this to anyone that wants to asynchronously keep up with a large number of people and wants to share photos, comments, video, etc. It&amp;#39;s really well done. However, beware of many of the facebook apps. They tend to spam your friends list - sometimes even when they don&amp;#39;t ask. Outside of better requirements on fb app developers, I don&amp;#39;t have a lot of complaints there. 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Having said that, neither of us is doing anything else (no Plaxo, no LinkedIn, etc.) so if you want to find us - we&amp;#39;re definitely around but we&amp;#39;re going to stay &lt;em&gt;somewhat&lt;/em&gt; focused. ;-) 
&lt;/p&gt;
&lt;p&gt;
And, now that I&amp;#39;m back home again, I hope to have a few more of my longer posts done. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Cheers everyone!&lt;br /&gt;
&lt;/strong&gt;kt 
&lt;/p&gt;
&lt;a href="http://www.facebook.com/people/Kimberly-L-Tripp/600530451" target="_TOP" title="Kimberly L. Tripp's Facebook profile"&gt;&lt;img style="border: 0px" src="http://badge.facebook.com/badge/600530451.1159.1643141752.png" alt="Kimberly L. Tripp's Facebook profile" hspace="10" width="120" height="309" align="left" /&gt;&lt;/a&gt; &lt;a href="http://www.facebook.com/people/Paul-Randal/1293146061" target="_TOP" title="Paul Randal's Facebook profile"&gt;&lt;img style="border: 0px" src="http://badge.facebook.com/badge/1293146061.635.649828437.png" alt="Paul Randal's Facebook profile" width="120" height="297" /&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:2-BVWluWmkA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:2-BVWluWmkA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:2-BVWluWmkA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=Qz7GdtEl824:2-BVWluWmkA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Qz7GdtEl824:2-BVWluWmkA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Social-networking-keeping-up-with-friendsfamily-and-getting-more-tech-info!.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Social-networking-keeping-up-with-friendsfamily-and-getting-more-tech-info!.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=6bcffd8e-b225-4135-befc-e2efe249a329</guid>
      <pubDate>Wed, 29 Apr 2009 12:37:00 -0800</pubDate>
      <category>Opinions</category>
      <category>Personal</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=6bcffd8e-b225-4135-befc-e2efe249a329</pingback:target>
      <slash:comments>12</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=6bcffd8e-b225-4135-befc-e2efe249a329</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Social-networking-keeping-up-with-friendsfamily-and-getting-more-tech-info!.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=6bcffd8e-b225-4135-befc-e2efe249a329</wfw:commentRss>
    </item>
    <item>
      <title>Companion content for Chapter 6 (Index Internals) of SQL Server 2008 Internals</title>
      <description>&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font face="verdana,geneva" size="2"&gt;Recently,&amp;nbsp;the &lt;/font&gt;&lt;a href="http://www.amazon.com/gp/product/0735626243/ref=s9_sims_c2_s1_p14_i1?pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_s=center-2&amp;amp;pf_rd_r=00E7E83CBCNR0DG2TMQ2&amp;amp;pf_rd_t=101&amp;amp;pf_rd_p=470938631&amp;amp;pf_rd_i=507846" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;SQL Server 2008 Internals&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; title was released (and only in the past few days have people actually received their copies)! In fact, I still haven&amp;#39;t seen the book in person... soon though!&lt;/font&gt; 
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
Anyway, &lt;a href="http://sqlblog.com/blogs/kalen_delaney/default.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Kalen&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, &lt;/font&gt;&lt;a href="http://www.SQLskills.com/blogs/Paul" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Paul&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, &lt;/font&gt;&lt;a href="http://blogs.msdn.com/conor_cunningham_msft/default.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Conor&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, &lt;/font&gt;&lt;a href="http://sqlblog.com/blogs/adam_machanic/default.aspx" target="_blank"&gt;&lt;font face="verdana,geneva" size="2"&gt;Adam&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;&amp;nbsp;and I worked to create a comprehensive resource on SQL Server 2008 internals and to supplement the written content, many of us created demo scripts and examples. I&amp;#39;ve now gone back and created a sample script based on ALL of the code in the entire chapter (and in many cases I extended the code in the samples). And, while this updated content is going to be located on the companion content site, I thought I&amp;rsquo;d also release it here with some notes.&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font face="verdana,geneva" size="2"&gt;The zip contains a solution with 3 projects, each with a few scripts: &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/KIMBERLY/image.axd?picture=2009%2f4%2fIndexInternals-Chapter6-Resources.jpg" alt="" width="547" height="680" /&gt;&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;I know the names seem a bit strange but everything is ordered EXACTLY as it is shown in the book. And, in the book, I referenced &amp;quot;a&amp;quot; script called EmployeeCaseStudy-AnalyzeStructures.sql but that script was so big that I broke it down into 7 parts (hence the naming convention of 06...01, 06...02, etc.). Regardless, each script contains a brief header and a few details about the script. To get the most from the script, do not just open the script and execute it. If you really work your way through the script, you should see all of the comments and they will help you to make instance specific changes so that everything runs without error. Just take your time and really try to step back and think about each command (and what you&amp;#39;re expecting the output to be) to test yourself while your working through the results. Taking your time and really grapsing all of these internals is what makes it fun!&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;Quite a bit of this content can stand alone but it&amp;#39;s really best as companion content to the title as there&amp;#39;s a lot more &amp;quot;text&amp;quot; and detailed information in the book. But, the scripts are really a great way to dive deeper, learn documented/undocumented commands and really get to know what the heck is really going on internally.&lt;/font&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;Finally, I only worked on Chapter 6 so here it is: &lt;a href="http://www.sqlskills.com/BLOGS/KIMBERLY/file.axd?file=2009%2f8%2f20090810-IndexInternals-Chapter6-Resources.zip"&gt;20090810-IndexInternals-Chapter6-Resources.zip (6.13 mb)&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;. As for the other companion content, you&amp;#39;ll need to get&amp;nbsp;the links from the book. Ah, or&amp;nbsp;from Kalen :).&amp;nbsp; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;And, certainly, if you find a typo or anything that you think needs more clarification, let me know! I&amp;#39;m more than happy to post updates to this content.&amp;nbsp; &lt;/font&gt;
&lt;/p&gt;
&lt;p style="margin: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;font size="2"&gt;&lt;strong&gt;Have fun,&lt;/strong&gt;&lt;br /&gt;
kt &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font size="2"&gt;UPDATES/ERRORLOG: &lt;/font&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;2009-Apr-13 (8am): &lt;/strong&gt;Updated the zip after remembering in my sleep (yes, sad, but true!) that one of my &lt;strong&gt;comments&lt;/strong&gt; that referenced some line numbers didn&amp;#39;t get updated in the final version. So, no errors and if you don&amp;#39;t get this update, it&amp;#39;s not going to break anything. But, the script that&amp;#39;s been tweaked is script: &lt;font face="courier new,courier"&gt;05_EmployeeCaseStudy-TableDefinition.sql&lt;/font&gt;. Enjoy! kt &lt;br /&gt;
&lt;strong&gt;2009-Apr-13 (4:30pm): &lt;/strong&gt;Ha... guess what arrived today. Yes - our copies of the book. Wow, it&amp;#39;s great to see it in person. Again, enjoy! &lt;br /&gt;
&lt;strong&gt;2009-Aug-10:&amp;nbsp;&lt;/strong&gt;Added a&amp;nbsp;:CONNECT option inside the&amp;nbsp;IndexInternals restore script AND, cleaned up the zip as it had an extra copy of the IndexInternals database&amp;nbsp;in it. 
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:H7zdU7WyKUs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:H7zdU7WyKUs:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:H7zdU7WyKUs:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?i=Z3wEZKJoS6I:H7zdU7WyKUs:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/KimberlyLTripp?a=Z3wEZKJoS6I:H7zdU7WyKUs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/KimberlyLTripp?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <link>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Companion-content-for-Chapter-6-(Index-Internals)-of-SQL-Server-2008-Internals.aspx</link>
      <author>kimberly.nospam@nospam.sqlskills.com (kltripp)</author>
      <comments>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Companion-content-for-Chapter-6-(Index-Internals)-of-SQL-Server-2008-Internals.aspx#comment</comments>
      <guid>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=85a23001-cdb9-453a-8e51-ee731c1c2991</guid>
      <pubDate>Sun, 12 Apr 2009 23:20:00 -0800</pubDate>
      <category>Indexes</category>
      <category>Resources</category>
      <category>SQL Server 2008</category>
      <category>Inside the storage engine</category>
      <dc:publisher>kltripp</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/KIMBERLY/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/KIMBERLY/post.aspx?id=85a23001-cdb9-453a-8e51-ee731c1c2991</pingback:target>
      <slash:comments>92</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/KIMBERLY/trackback.axd?id=85a23001-cdb9-453a-8e51-ee731c1c2991</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/KIMBERLY/post/Companion-content-for-Chapter-6-(Index-Internals)-of-SQL-Server-2008-Internals.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/KIMBERLY/syndication.axd?post=85a23001-cdb9-453a-8e51-ee731c1c2991</wfw:commentRss>
    </item>
  </channel>
</rss>
