<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>LittleKendra.com</title>
	<atom:link href="http://thedbaknows.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thedbaknows.wordpress.com</link>
	<description>Delicious, delicious data.</description>
	<lastBuildDate>Fri, 11 Mar 2011 19:07:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thedbaknows.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/6c7b5299ab19223e3fcfead7057373bf?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>LittleKendra.com</title>
		<link>http://thedbaknows.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thedbaknows.wordpress.com/osd.xml" title="LittleKendra.com" />
	<atom:link rel='hub' href='http://thedbaknows.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Date Rounding Tactics and the Tiny Devil of SMALLDATETIME</title>
		<link>http://thedbaknows.wordpress.com/2011/01/04/daterounding/</link>
		<comments>http://thedbaknows.wordpress.com/2011/01/04/daterounding/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 14:30:43 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[DATE]]></category>
		<category><![CDATA[DATEADD]]></category>
		<category><![CDATA[DATEDIFF]]></category>
		<category><![CDATA[DATEPART]]></category>
		<category><![CDATA[DATETIME]]></category>
		<category><![CDATA[Rounding]]></category>
		<category><![CDATA[SMALLDATETIME]]></category>
		<category><![CDATA[TSQL]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1448</guid>
		<description><![CDATA[Happy New Year! With every new year I think a little bit about time and dates, so let&#8217;s look at that in TSQL. Rounding Dates: Which way is best? Sometimes in TSQL you need to round a datetime value to the precision of either a day, hour, minute, or second. I realized recently that I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1448&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Happy New Year! With every new year I think a little bit about time and dates, so let&#8217;s look at that in TSQL.</p>
<p><span style="font-size:15px;font-weight:bold;">Rounding Dates: Which way is best?</span></p>
<p>Sometimes in TSQL you need to round a datetime value to the precision of either a day, hour, minute, or second.</p>
<p>I realized recently that I have a few ways I know how to do this, but I wasn&#8217;t sure which was the most efficient.</p>
<p>I did a little searching and didn&#8217;t find anything super conclusive. I had a little chat with Jeremiah Peschka (<a href="http://facility9.com/about" target="_blank">blog</a> | <a href="http://twitter.com/#!/PeschkaJ" target="_blank">twitter</a>) and he told me which way he thought was fastest and why.</p>
<p>And so I decided to run some tests. Jeremiah has a way of being right about these things, but I had to see for myself.</p>
<p><em>I&#8217;ll go ahead and tell you</em>: He was totally right, and I&#8217;ll show you why. But I learned a couple things along the way.</p>
<h3>Reference: Types and Storage Sizes</h3>
<p>To get started, let&#8217;s review some of our friends, the SQL Server datatypes. Hi friends!</p>
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr bgcolor="cornsilk">
<th>DataType</th>
<th>Storage Size</th>
<th>Note</th>
</tr>
<tr>
<td>DateTime</td>
<td>8 bytes</td>
<td>Rounded to increments of .000, .003, or .007 seconds</td>
</tr>
<tr>
<td>DateTime2()</td>
<td>6 bytes for precisions less than 3; 7 bytes for precisions 3 and 4. All other precisions require 8 bytes.</td>
<td>0 to 7 digits, with an accuracy of 100ns. The default precision is 7 digits.</td>
</tr>
<tr>
<td>Date</td>
<td>3 bytes</td>
<td>1, 3-byte integer stores date.</td>
</tr>
<tr>
<td>SmallDateTime</td>
<td>4 bytes</td>
<td>Be very careful! Values of 29.999 seconds or more are rounded up to the nearest minute.</td>
</tr>
<tr>
<td>BigInt</td>
<td>8 bytes</td>
<td>I&#8217;ll explain why this is here later. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </td>
</tr>
</tbody>
</table>
<h3>Rounding to the Day</h3>
<p>The most frequent case in which I need to round dates is to the day level. So instead of &#8217;1/4/2011 6:15:03.393921&#8242;, I want just &#8217;1/4/2011&#8242;.</p>
<p>SQL 2008&#8242;s date type made this a lot easier for everyone&#8211; now we can just cast a datetime or datetime2 value as a date, and we&#8217;ve got what we need. PLUS, our new value is nice and small, weighing in at 3 bytes.</p>
<p>I think most everyone agrees, we like this!</p>
<p><pre class="brush: sql;">
SELECT CAST('1/1/2010 23:59:59.000' AS DATE) AS [I'm a date!]
</pre></p>
<h3>Rounding to Hours, Minutes, or Seconds:<br />
Beware the tiny devil of SMALLDATETIME</h3>
<p>This is still a bit more complicated. When  you start thinking about these and different datatypes, you need to make sure you understand what you mean by <em>rounding</em>.</p>
<p>In SQL Server, our datatypes actually have some different opinions about what rounding means. Check this out:</p>
<p><pre class="brush: sql;">
SELECT
    CAST('1/1/2010 23:59:59.000' AS DATETIME) AS [I'm a DATETIME!],
    CAST('1/1/2010 23:59:59.000' AS DATETIME2(0))  AS [I'm a DATETIME2(0)!'],
    CAST('1/1/2010 23:59:59.000' AS SMALLDATETIME) AS [I'm a SMALLDATETIME, and I'm very confused.],
    CAST('1/1/2010 23:59:59.000' AS DATE) AS [I'm a DATE!]
</pre></p>
<p>This returns:</p>
<p><a href="http://thedbaknows.files.wordpress.com/2011/01/smalldatetimerounding.jpg"><img class="alignnone size-full wp-image-1455" title="smalldatetimerounding" src="http://thedbaknows.files.wordpress.com/2011/01/smalldatetimerounding.jpg?w=468&#038;h=50" alt="" width="468" height="50" /></a></p>
<p>The SMALLDATETIME value rounds this up to January 2nd, instead of January 1. The Date datatype does not.</p>
<p>In considering whether or not to use SMALLDATETIME, you need to learn and establish whether or not to round up for minutes and date values. With a different example, if something occurred at 12:30:31 AM, would that be represented as having  happened in the 12:30 minute, or at 12:31?</p>
<p>Most of us actually want to round <strong>down</strong>. We want the largest minute number which is less than or equal to the datetime value. This is similar to what FLOOR does for integers. You could also call this truncating the portion of the datetime value you don&#8217;t want.  This is <em>not</em>, however, what SMALLDATETIME gives you, so use it with care.</p>
<p>So this is what I&#8217;m saying:</p>
<blockquote><p><em>Like, seriously, SMALLDATETIME: you are <strong>SO</strong> messed up.</em></p></blockquote>
<h3>Comparing Methods of Rounding Dates</h3>
<p>So given that warning, let&#8217;s actually round some date values, and let&#8217;s compare the efficiency of each method.</p>
<p>To start out with, let&#8217;s create a table and toss in a bunch of date values. We&#8217;ll run queries against these dates and measure SQL Server&#8217;s abilities to work with it.</p>
<p>To make up a bunch of datetime data, I&#8217;m using my trusty recursive CTE from my <a href="http://littlekendra.com/2010/12/23/mindthegap/" target="_blank">prior post</a>.</p>
<p><pre class="brush: sql;">

--Populate a table with some data
CREATE TABLE dbo.Donuts ( DonutTime DATETIME2(7) )

DECLARE
    @startDate DATETIME2(7)= '2010-12-01 00:00:00' ,
    @endDate DATETIME2(7)= '2010-12-11 01:30:00' ;

WITH    MyCTE
          AS ( SELECT
                @startDate AS [Makin' the Donuts]
               UNION ALL
               SELECT
                DATEADD(ms, 1225, [Makin' the Donuts])
               FROM
                MyCTE
               WHERE
                [Makin' the Donuts] &lt; @endDate )
    INSERT  dbo.Donuts
            SELECT
                [Makin' the Donuts]
            FROM
                MyCTE
    OPTION
                ( MAXRECURSION 0 ) ;

SELECT @@ROWCOUNT
--We now have 709716 rows of DonutTime

</pre></p>
<p>Now let&#8217;s look at different methods to manipulate datevalues. For our examples I&#8217;ll be rounding to the minute.</p>
<h3>Contestant 1 -<br />
DATEPART: isolate each part of the date, then concatenate</h3>
<p>As we learn TSQL, this is the first method that occurs to us. We know DATEPART will return part of a date (great name!), so we can chop apart the bits. However, to get them back together properly we have to turn each part into a string to clue them back together. And then if we want to treat it like a date (which we pretty much always do), we have to cast it back.</p>
<p>Just look at this baby. It&#8217;s pretty ugly.</p>
<p><pre class="brush: sql;">
SELECT
    CAST(CAST(DATEPART(YY, DonutTime) AS CHAR(4)) + '-' + CAST(DATEPART(MM, DonutTime) AS NVARCHAR(2)) + '-'
    + CAST(DATEPART(DD, DonutTime) AS NVARCHAR(2)) + '  ' + CAST(DATEPART(hh, DonutTime) AS NVARCHAR(2)) + ':'
    + CAST(DATEPART(mi, DonutTime) AS NVARCHAR(2)) + ':00.000' AS DATETIME2(0)) AS [Wow, that was a lot of typing.]
FROM
    dbo.Donuts
</pre></p>
<p>Running this (after cleaning out buffers), I got these results:</p>
<p><a href="http://thedbaknows.files.wordpress.com/2011/01/datepartresults.jpg"><img class="alignnone size-full wp-image-1459" title="DatePartResults" src="http://thedbaknows.files.wordpress.com/2011/01/datepartresults.jpg?w=351&#038;h=79" alt="" width="351" height="79" /></a></p>
<h3>Contestant 2 -<br />
Subtracting what you don&#8217;t want</h3>
<p>There&#8217;s a couple of variations on contestant #2. I&#8217;ll take the one I like best, which is casting to a smaller byte size by using DATETIME2(0), which is 6 bytes rather than 8 and effectively truncates to the second. Then I&#8217;ll subtract the seconds.</p>
<p><pre class="brush: sql;">
SELECT
    DATEADD(ss, -DATEPART(ss, DonutTime), CAST (DonutTime AS DATETIME2(0)))
FROM
    dbo.Donuts
</pre></p>
<p>Running this one (yes, I cleaned out the buffers), I got these results:</p>
<p><a href="http://thedbaknows.files.wordpress.com/2011/01/dateadddatepartresults.jpg"><img class="alignnone size-full wp-image-1468" title="DateAddDatepartResults" src="http://thedbaknows.files.wordpress.com/2011/01/dateadddatepartresults.jpg?w=351&#038;h=81" alt="" width="351" height="81" /></a></p>
<p>Well now, that&#8217;s much lower CPU time there.</p>
<p><em>NB</em>: I did test, and in all my trials it was lower CPU time to cast into DATETIME2 rather than using a nested DATEADD function to subtract milliseconds.</p>
<h3>Contestant 3-<br />
Convert to a shorter character string, then back to date</h3>
<p>This contestant is near and dear to my heart. I like it because it&#8217;s easy for me to remember. You take a short trip into CHAR() with the 121 date format and set the length to chop off the parts of the date you don&#8217;t want. Then you cast or convert back to a DATETIME2(0).</p>
<p>I think I like this one because it feels just a little bit violent. But not in a bad way. It&#8217;s like roller derby.</p>
<p><pre class="brush: sql;">
SELECT
    CAST(CONVERT(CHAR(16), DonutTime, 121) AS DATETIME2(0))
FROM
    dbo.Donuts
</pre></p>
<p><a href="http://thedbaknows.files.wordpress.com/2011/01/char121conversionresults.jpg"><img class="alignnone size-full wp-image-1470" title="CHAR121ConversionResults" src="http://thedbaknows.files.wordpress.com/2011/01/char121conversionresults.jpg?w=343&#038;h=83" alt="" width="343" height="83" /></a></p>
<p>Oh, sad. This one didn&#8217;t do very well. It&#8217;s definitely better than Contestant #1, at least.</p>
<h3>Contestant 4-<br />
Use DATEADD to calculate the minutes since a given date, then add them back</h3>
<p>Here&#8217;s the method Jeremiah suggested to me. The way he described it was &#8220;Just figure out the number of minutes since the beginning of time, and use that.&#8221;</p>
<p>Being a philosophy major, I of course asked &#8220;So, when <em>was</em> the beginning of time?&#8221;</p>
<p>Being a developer, he answered, &#8220;Just call it zero.&#8221;</p>
<p><pre class="brush: sql;">
SELECT
    DATEADD(mi, DATEDIFF(mi, 0, CAST(DonutTime AS DATETIME2(0))), 0)
FROM
    dbo.Donuts
</pre></p>
<p>Here are the results (clean buffers, as usual):</p>
<p><a href="http://thedbaknows.files.wordpress.com/2011/01/dateadddatediffresults1.jpg"><img class="alignnone size-full wp-image-1472" title="DateAddDateDiffResults" src="http://thedbaknows.files.wordpress.com/2011/01/dateadddatediffresults1.jpg?w=360&#038;h=86" alt="" width="360" height="86" /></a></p>
<p>Ooo, check out the CPU time on that one.</p>
<p><em>Note</em>: I ran a few trials and this is faster on the CPU when you cast as DATETIME2(0) before doing your maths. I did that to make all things equal with the other contestants, who had the same benefit.</p>
<h3>Who Won, and Why</h3>
<p>Here&#8217;s a recap of how everyone performed:</p>
<table border="1" cellspacing="0" cellpadding="5">
<tbody>
<tr bgcolor="cornsilk">
<th>Contestant</th>
<th>CPU Time (ms)</th>
<th>Notes</th>
</tr>
<tr>
<td>Contestant 1-<br />
DatePart o&#8217; Rama</td>
<td>1872</td>
<td>I&#8217;m really glad this didn&#8217;t win. Because it&#8217;s awful to type. I almost wanted to skip  it, it&#8217;s so unpleasant.</td>
</tr>
<tr>
<td>Contestant 2-<br />
Subtract What You Don&#8217;t Want</td>
<td>375</td>
<td>An admirable CPU time! And altogether a lovely contestant. Check how this performs for your specific task.</td>
</tr>
<tr>
<td>Contestant 3-<br />
Convert to CHAR and back</td>
<td>905</td>
<td>Sad, I really like this one. But although this dog will hunt, it doesn&#8217;t seem to do it all that well.</td>
</tr>
<tr>
<td>Contestant 4-<br />
DATEDIFF from the beginning of time, as expressed in DATETIME2(0)</td>
<td>172</td>
<td>Well now, that&#8217;s impressive.</td>
</tr>
</tbody>
</table>
<p>Why did contestants 2 and 4 do so well?</p>
<p>Jeremiah pointed out that datetime values are stored internally as two four byte integers. (<a href="http://msdn.microsoft.com/en-us/library/ms187819(v=SQL.90).aspx">BOL reference: see &#8220;Remarks&#8221;</a>) Performing mathematic functions on an integer value is a nice fast activity on the CPU.</p>
<p>Performing conversions back and forth to character based datatypes, however, is not so natural, nor so fast.</p>
<p>What&#8217;s the internal storage format of DateTime2?  Well, I&#8217;m not sure about that one. <a href="http://msdn.microsoft.com/en-us/library/bb677335.aspx" target="_blank">BOL isn&#8217;t so up-front about these things anymore</a>. If you happen to know, please tell me in the comments. I can tell, however, that it&#8217;s something that enjoys mathematics.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1448/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1448/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1448/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1448&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2011/01/04/daterounding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2011/01/smalldatetimerounding.jpg" medium="image">
			<media:title type="html">smalldatetimerounding</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2011/01/datepartresults.jpg" medium="image">
			<media:title type="html">DatePartResults</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2011/01/dateadddatepartresults.jpg" medium="image">
			<media:title type="html">DateAddDatepartResults</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2011/01/char121conversionresults.jpg" medium="image">
			<media:title type="html">CHAR121ConversionResults</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2011/01/dateadddatediffresults1.jpg" medium="image">
			<media:title type="html">DateAddDateDiffResults</media:title>
		</media:content>
	</item>
		<item>
		<title>2010 liner notes and my theme for 2011</title>
		<link>http://thedbaknows.wordpress.com/2010/12/30/2010-liner-notes/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/30/2010-liner-notes/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 14:30:46 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[liner notes]]></category>
		<category><![CDATA[thank you]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1485</guid>
		<description><![CDATA[The MorningNews asked the following question recently: Who you would recognize in your 2010 liner notes? To all the people in your lives (maybe you know them, maybe you don’t) who deserve shout-outs, a la the album’s notes, the book’s acknowledgments, the piece’s title, the award’s dedication. Who would you include in your 2010 acceptance [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1485&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The MorningNews <a href="http://www.themorningnews.org/archives/announcements/liner_notes_2010.php" target="_blank">asked the following question</a> recently:</p>
<p style="padding-left:30px;"><em><strong>Who you would recognize in your 2010 liner notes?</strong></em></p>
<p style="padding-left:30px;"><em>To all the people in your lives (maybe you know them, maybe you don’t) who deserve shout-outs, a la the album’s notes, the book’s acknowledgments, the piece’s title, the award’s dedication. Who would you include in your 2010 acceptance speech? Maybe your fifth grade teacher, the buddy who got you through a brutal summer, the musician who had you walking tall during a particular slog.</em></p>
<div class="mceTemp" style="padding-left:30px;">
<dl class="wp-caption alignright">
<dt class="wp-caption-dt"><em><img class="size-full wp-image-1489  " title="Grandparents" src="http://thedbaknows.files.wordpress.com/2010/12/image-3.jpg?w=119&#038;h=179" alt="" width="119" height="179" align="alignright" /></em></dt>
<dd class="wp-caption-dd">My grandparents</dd>
</dl>
</div>
<h3>A lot changed in 2010</h3>
<p>I don&#8217;t write much about my personal life on this blog, but in short: I changed jobs, moved house, and I&#8217;m in a new relationship. My last grandparent passed away. I remembered that life is finite.</p>
<h3>2010 &#8211; The liner notes</h3>
<p><strong>To My Mamaw:</strong></p>
<p style="padding-left:30px;">You not only taught me how to draw, you taught me how to love it, and how to be patient and thoughtful when it doesn&#8217;t turn out exactly like I planned. When I create art, I&#8217;ll always think of you. You also showed me what it is to love someone more than anything else, and how to live gracefully with loss. I love that about you.</p>
<div id="attachment_1491" class="wp-caption alignright" style="width: 136px"><img class="size-medium wp-image-1491 " title="FxCam_1280505384455-1" src="http://thedbaknows.files.wordpress.com/2010/12/fxcam_1280505384455-1.jpg?w=126&#038;h=168" alt="" width="126" height="168" /><p class="wp-caption-text">Me with Crys in West Palm Beach</p></div>
<p><strong>To Crys Manson ( <a href="http://crysmanson.com/" target="_blank">b</a> / <a href="twitter.com/#!/@crysmanson" target="_blank">t</a> ):</strong></p>
<p style="padding-left:30px;">Thanks for convincing me to do things which I fear will make me:<br />
a) exhausted, b) terrified, c) nauseous d) all of the above.<br />
You&#8217;re a fantastic friend a the BEST DBA co-pilot ever. You make me a better person.<br />
I&#8217;ll fly into West Palm Beach with  you anytime.</p>
<p><strong>To Organizers of SQL Saturday Nashville, Iowa City, and Washington DC ( <a href="http://sqlsaturday.com/" target="_blank">b</a> ):</strong></p>
<p style="padding-left:30px;">Thanks for putting on a great show, and for the speaking opportunities. It&#8217;s been crazy good. I&#8217;ve loved the chance to travel to places I&#8217;ve never been and meet all sorts of smart people. Thanks for letting me figure out how to get up and talk in front of a group of strangers, and for letting me learn from other people&#8217;s presentations.</p>
<p><strong>To Brent Ozar ( <a href="http://brentozar.com/" target="_blank">b</a> / <a href="http://twitter.com/brento" target="_blank">t</a> ) and Tim Ford ( <a href="http://thesqlagentman.com/" target="_blank">b</a> / <a href="http://twitter.com/#!/sqlagentman" target="_blank">t</a> ):</strong></p>
<div id="attachment_1492" class="wp-caption alignright" style="width: 199px"><img class="size-medium wp-image-1492  " title="Back Camera" src="http://thedbaknows.files.wordpress.com/2010/12/clowncar-copy-copy.jpg?w=189&#038;h=141" alt="" width="189" height="141" /><p class="wp-caption-text">SQL Clown Car</p></div>
<p style="padding-left:30px;">Thanks for not just throwing an awesome party, but for really making friends.<br />
I still owe you guys a ride to Tacoma.</p>
<p><strong>To Richard Kim:</strong></p>
<p style="padding-left:30px;">Thanks for believing in me so much, and for understanding me better than I know myself, sometimes.</p>
<p><strong>To Len Cozza and Richard Fried: </strong></p>
<p style="padding-left:30px;">Thanks for the honest, thoughtful, sane conversations, in a crazy place and time.<strong> </strong></p>
<p><strong>To Dev Nambi ( <a href="http://twitter.com/#!/@kosmedi" target="_blank">t</a> ):</strong></p>
<p style="padding-left:30px;">I love how passionate and good you are at what you do. I&#8217;m sure I&#8217;ll still think of calling you if I have crazy new performance issues to talk about. Except that&#8217;s probably not really appropriate now.</p>
<p><strong> </strong></p>
<p><strong>To My Former Employer, Whom I Have Not Explicitly Named Herein:</strong></p>
<p style="padding-left:30px;">Thanks  for bringing me in touch with smart and interesting people from so many different  places. I don&#8217;t really miss you because, let&#8217;s face it, we still spend a <em>lot</em> of time together in so many ways, and that&#8217;s a good thing.</p>
<p><strong>To My New Employer:</strong></p>
<p style="padding-left:30px;">We&#8217;re going to do some <em>really </em>awesome stuff.<br />
And <em>way to go </em>for having the gym onsite and offering free physical training sessions. Seriously awesome.</p>
<p><strong>To Carl, the Giant Rabbit ( <a href="http://twitter.com/#!/databunnyadmn" target="_blank">t</a> ):</strong></p>
<div id="attachment_1493" class="wp-caption alignright" style="width: 138px"><a href="http://thedbaknows.files.wordpress.com/2010/12/carl.jpg"><img class="size-medium wp-image-1493 " title="Carl" src="http://thedbaknows.files.wordpress.com/2010/12/carl.jpg?w=128&#038;h=192" alt="" width="128" height="192" /></a><p class="wp-caption-text">Carl, who wants nothing to do with ramps.</p></div>
<p style="padding-left:30px;">Thanks for all the headbutts, and for dancing on your hind feet in greedy mango-lust.<br />
Sorry about those litter box shavings you didn&#8217;t like. I won&#8217;t do that EVER again.</p>
<p><strong>To Kevin Kline ( <a href="http://sqlblog.com/blogs/kevin_kline/" target="_blank">b</a> / <a href="http://twitter.com/kekline" target="_blank">t</a> ): </strong></p>
<p style="padding-left:30px;">I&#8217;m not sure if you&#8217;re aware that I owe you an ice cream cone.</p>
<p><strong>To Jeremiah Peschka ( <a href="http://facility9.com" target="_blank">b</a> / <a href="http://twitter.com/#!/peschkaj" target="_blank">t</a> ):</strong></p>
<p style="padding-left:30px;">Good choice asking me to be on your SQL PASS Quiz Bowl team!<br />
Thanks for helping me remember the books I love to read, and for helping me think about things differently sometimes. For getting me to listen to new music, and teaching me to talk in dinosaur. And for creating your own datatype. Let&#8217;s go get some tacos and I&#8217;ll tell you the rest.</p>
<h3>2011: Theme for next year</h3>
<p>My theme for next year comes from <a href="http://blog.penelopetrunk.com/2007/12/18/bad-career-advice-do-what-you-love/" target="_blank">a blog post by Penelope Trunk from 2007</a>:</p>
<p style="padding-left:30px;"><em>Here&#8217;s some practical advice: Do not what you love; do what you <span style="text-decoration:underline;">are</span>. &#8230;</em></p>
<p style="padding-left:30px;"><em>Relationships make your life great, not jobs.  But a job can ruin your life – make you feel out of control in terms of your time or your ability to accomplish goals –  but no job will make your life complete. It&#8217;s a myth mostly propagated by people who tell you to do what you love. Doing what you love will make you feel fulfilled. But you don&#8217;t need to get paid for it.</em></p>
<div id="attachment_1490" class="wp-caption alignright" style="width: 152px"><img class="size-medium wp-image-1490" title="1288280946689" src="http://thedbaknows.files.wordpress.com/2010/12/1288280946689.jpg?w=142&#038;h=189" alt="" width="142" height="189" /><p class="wp-caption-text">A conversation about cheesecake and President Clinton</p></div>
<p>In many ways, I&#8217;m lucky, because I love nerding out on SQL Server and talking about it. But I don&#8217;t love <em>all</em> the responsibilities and trappings of work. This next year I want to devote to respecting my job and being a great contributor (and my new job <em>is</em> interesting and exciting), but also separating out and making plenty of time for what I love.</p>
<p>In 2011 I want to become a better speaker, because I love doing it. I want to develop more presentations and think through creating training materials around RDBMses, because I enjoy it.  I&#8217;ll probably learn plenty of things in doing this that make me better at  my job, and that&#8217;s icing.</p>
<p>Which leads me to my <strong>most important goal for 2011</strong>: take time to have fun with people I love outside of work. Schedule it. Stick with it. Do it unless the world is on fire. And if the world&#8217;s truly on fire, take the time back within a week.</p>
<p>I&#8217;m going to learn to be a better partner, to make plenty of time for zombie movies, and to sometimes think <em>nothing at all </em>about SQL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1485/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1485/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1485/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1485&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/30/2010-liner-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/image-3.jpg" medium="image">
			<media:title type="html">Grandparents</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/fxcam_1280505384455-1.jpg?w=225" medium="image">
			<media:title type="html">FxCam_1280505384455-1</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/clowncar-copy-copy.jpg?w=300" medium="image">
			<media:title type="html">Back Camera</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/carl.jpg?w=200" medium="image">
			<media:title type="html">Carl</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/1288280946689.jpg?w=225" medium="image">
			<media:title type="html">1288280946689</media:title>
		</media:content>
	</item>
		<item>
		<title>Why I&#8217;m All For 24HOP Showcasing 24 Women Speakers</title>
		<link>http://thedbaknows.wordpress.com/2010/12/27/wimmin_n_24hop/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/27/wimmin_n_24hop/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 14:00:41 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[SQL PASS]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1556</guid>
		<description><![CDATA[I&#8217;ve been thinking about the upcoming 24HOP event planned for March 15 and 16 which will showcase 24 women speakers. Karen Lopez (post &#124; twitter), Jenn Stirrup (post &#124; twitter), and Jen McCown (post &#124; twitter) have all written posts about it. Kalen Delaney ( blog&#124;twitter) has left some comments with her views, which I&#8217;ve also [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1556&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_1568" class="wp-caption alignright" style="width: 224px"><img class="size-medium wp-image-1568" title="Carl" src="http://thedbaknows.files.wordpress.com/2010/12/pict0846.jpg?w=214&#038;h=300" alt="" width="214" height="300" /><p class="wp-caption-text">This is not the HOP you are looking for.</p></div>
<p>I&#8217;ve been thinking about the <a href="http://www.sqlpass.org/LinkClick.aspx?fileticket=KIIjFLt_f7I%3D&amp;tabid=64&amp;mid=791" target="_blank">upcoming 24HOP event</a> planned for March 15 and 16 which will showcase 24 women speakers. Karen Lopez (<a href="http://blog.infoadvisors.com/index.php/2010/12/10/trolling-the-24hop/" target="_blank">post </a>| <a href="http://twitter.com/datachick" target="_blank">twitter</a>), Jenn Stirrup (<a href="http://www.jenstirrup.com/2010/12/sqlpass-24-hour-women-in-technology-hop.html" target="_blank">post</a> | <a href="http://twitter.com/jenstirrup" target="_blank">twitter</a>), and Jen McCown (<a href="http://www.midnightdba.com/Jen/2010/12/24hop-wit-in-march-jen-says-yes/" target="_blank">post </a>| <a href="http://twitter.com/MidnightDBA" target="_blank">twitter</a>) have all written posts about it. Kalen Delaney ( <a href="http://sqlblog.com/blogs/kalen_delaney/" target="_blank">blog</a>|<a href="http://twitter.com/SQLQueen" target="_blank">twitter</a>) has left some comments with her views, which I&#8217;ve also appreciated.</p>
<p>If you&#8217;re not sure what 24HOP is, prepare yourself for an acronym within an acronym: 24HOP = 24 Hours of PASS. PASS= the Professional Association for SQL Server. This is an online event featuring 24 one-hour sessions on all sorts of nerdy relational database topics.</p>
<p>This will be the fourth 24HOP event, I believe&#8211; there have been two general-topic English speaking events, and one Spanish and Portuguese language 24HOP event (LATAM HOP).</p>
<p>Some people think it&#8217;s a bad idea to have a woman-only 24HOP. And there are some thoughtful comments on why that might be the case.</p>
<p>However, I think it&#8217;s a very <strong><em>smart</em></strong> idea.</p>
<p>Think about this from the perspective of an editor who is putting together a collection of great fiction. You have a lot of choices when it comes to your book&#8211; you can choose items by theme, by time period, by genre, or by some factor of the author&#8211; their culture, their gender, their age.</p>
<p>A way to make a collection compelling is by a subtle thread. You want a variety of topics, and you want things in your collection to be different and interesting. There are many good types of way to build a collection, and one of those ways is by gender.</p>
<p>So if you&#8217;re a person who&#8217;s put on a few 24HOP events, do you want to put on something that&#8217;s very much like the one you did before? With maybe a little bit of new feature content?</p>
<p>Wouldn&#8217;t it be way more exciting, and a bit risky, to come up with a challenging idea that creates an interesting and different collection of speakers? It might spur your crowd of presenters to be creative and invested in the event more than a more general speaking engagement.</p>
<p>Well, I think so, at least. Regardless of the gender issue itself, I think this is a smart theme to build new content for the community.</p>
<p>High five, <a href="http://thomaslarock.com/2010/12/i-need-more-women/" target="_blank">Tom LaRock</a>.</p>
<h3>Do I Want to Present?</h3>
<p>I do!</p>
<p>I submitted a session. The title is &#8220;No More Bad Dates: Using Temporal Data Wisely&#8221;</p>
<p>(I am actually really excited about the topic. Yeah, dates and times&#8212; all sorts of weird fun to be had.)</p>
<p><span style="font-size:15px;font-weight:bold;">Would I have Submitted a Session if it Wasn&#8217;t Women-Only?</span></p>
<p>Nope.</p>
<p>Here&#8217;s why: SQL Rally is coming up, and I&#8217;ve submitted two sessions for that.  SQL Rally and 24HOP are going to both do selections by popular vote.</p>
<p>And popularity contests are, frankly,<em><strong> terrifying</strong></em>. I almost didn&#8217;t submit to Rally altogether because of the risks of being voted Least Likely to Present.  But I talked myself into submitting two sessions because I really love presenting, and I know the SQL community down in Florida is super passionate and interesting.</p>
<p>So if this was a general-topic 24HOP, but with sessions now being selected by public vote, I would not have submitted. I&#8217;m concerned that by being up for votes on two bills, I&#8217;ll hurt my chances on whichever is voted on second, even though I&#8217;ve submitted different abstracts. (People may feel like they voted for me before, so they want to give their vote for someone else on the other to be more fair.) Plus, it&#8217;s frankly twice the anxiety. Did I mention that popularity contests are terrifying?</p>
<p>But I do think this 24HOP idea is exciting and a little risky, and I would like to do what I can to try to make it great, if only by submitting. So I decided to submit a session, also.</p>
<div id="attachment_1578" class="wp-caption alignright" style="width: 190px"><a href="http://thedbaknows.files.wordpress.com/2010/12/1289327014237-copy-1.jpg"><img class="size-medium wp-image-1578 " title="BuckAndJer" src="http://thedbaknows.files.wordpress.com/2010/12/1289327014237-copy-1.jpg?w=180&#038;h=240" alt="" width="180" height="240" /></a><p class="wp-caption-text">24Hop: Hat Edition</p></div>
<p>Even if I&#8217;m not selected, I want to see how this 24HOP turns out. Maybe it&#8217;ll be remarkably like the ones that came before. Maybe there&#8217;ll be just something a little different that you can&#8217;t put your finger on. Maybe it&#8217;ll be really unique.</p>
<h3>So, Should We Have 24 HOP Showcasing 24 Men Speakers?</h3>
<p>Well, I actually thought that would be a good idea. Until I realized that we&#8217;ve already had 24HOP featuring 23 men speakers. I think that means the theme wouldn&#8217;t generate much but confusion. It would be all sorts of &#8220;So&#8230; <strong><em>what</em></strong> are we supposed to be doing?&#8221;</p>
<p>But there are other things to group by. New speakers. New presentations only. Mythbusters 24HOP. Present about your favorite feature. Maybe it&#8217;s the whole event, maybe each day has a different theme, but I like the idea of a focus. You could do a 24HOP like those playwriting events where a whole production is created in 24 hours.</p>
<p>However this goes, I hope we continue to have experimentation with 24HOP. I&#8217;d really like for it to continue on in an exciting direction where it doesn&#8217;t quite do what you expect&#8211; otherwise I think it&#8217;ll get to be SQL PASS Express Edition, with Auto Close enabled.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1556/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1556&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/27/wimmin_n_24hop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/pict0846.jpg?w=214" medium="image">
			<media:title type="html">Carl</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/1289327014237-copy-1.jpg?w=225" medium="image">
			<media:title type="html">BuckAndJer</media:title>
		</media:content>
	</item>
		<item>
		<title>Filling in Data Potholes with Recursive CTEs</title>
		<link>http://thedbaknows.wordpress.com/2010/12/23/mindthegap/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/23/mindthegap/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 14:30:10 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[CTE]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1426</guid>
		<description><![CDATA[Imagine that you are writing a script that looks at data grouped by the minute. You notice that there are no rows for some minutes, and you&#8217;d like to display a value when that is the case, probably showing a count of zero. In thinking about this problem this week, I spent some time getting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1426&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_1432" class="wp-caption alignright" style="width: 250px"><img class="size-medium wp-image-1432" title="MindTheGap" src="http://thedbaknows.files.wordpress.com/2010/12/imuttoo_389666319_f45d439bde.jpg?w=240&#038;h=180" alt="" width="240" height="180" /><p class="wp-caption-text">Data: it can break your foot.</p></div>
<p>Imagine that you are writing a script that looks at data grouped by the minute. You notice that there are no rows for some minutes, and you&#8217;d like to display a value when that is the case, probably showing a count of zero.</p>
<p>In thinking about this problem this week, I spent some time getting to know CTEs (Common Table Expressions) again. And I came to the conclusion that I should spend <em>much</em> more time with them. Maybe I won&#8217;t end up using them all the time, but I should be looking at them regularly as options when I&#8217;m writing queries.</p>
<p>Here&#8217;s the story of a handy way I found to work with this.</p>
<h3>Let&#8217;s create some data</h3>
<p>Our story starts with some data. It&#8217;s been lovingly scripted out, but it has a few holes.</p>
<p><pre class="brush: sql;">
CREATE TABLE dbo.MyImperfectData (
    ItemDate DATETIME2(0) ,
    ItemCount SMALLINT )
GO

INSERT  dbo.MyImperfectData ( ItemDate, ItemCount )
VALUES  ( '2010-12-01 00:00:00', 12 ),
        ( '2010-12-01 00:01:00', 3 ),
        ( '2010-12-01 00:02:00', 6 ),
        ( '2010-12-01 00:03:00', 12 ),
        ( '2010-12-01 00:04:00', 24 ),
        ( '2010-12-01 00:05:00', 1 ),
		-- Gap where 6 would be
        ( '2010-12-01 00:07:00', 122 ),
        ( '2010-12-01 00:08:00', 1 ),
        ( '2010-12-01 00:09:00', 1244 ),
        ( '2010-12-01 00:10:00', 23 ),
        ( '2010-12-01 00:11:00', 12 ),
        ( '2010-12-01 00:12:00', 24 ),
        ( '2010-12-01 00:13:00', 27 ),
        ( '2010-12-01 00:14:00', 28 ),
		--Gap where 15, 16, 17 would be
        ( '2010-12-01 00:18:00', 34 ),
        ( '2010-12-01 00:19:00', 93 ),
        ( '2010-12-01 00:20:00', 33 ),
        ( '2010-12-01 00:21:00', 65 ),
        ( '2010-12-01 00:22:00', 7 ),
        ( '2010-12-01 00:23:00', 5 ),
		--Gap where 24 would be
        ( '2010-12-01 00:25:00', 4 ),
        ( '2010-12-01 00:26:00', 6 ),
        ( '2010-12-01 00:27:00', 7 ),
        ( '2010-12-01 00:28:00', 77 ),
        ( '2010-12-01 00:29:00', 94 )

CREATE UNIQUE CLUSTERED INDEX cxMyCTE ON dbo.MyImperfectData(ItemDate)
</pre></p>
<p>The data is at the minute level. We&#8217;re missing data for five minutes in this period&#8211; one three minute chunk, and two other minutes.</p>
<h3>What&#8217;s the quickest way to show the missing rows?</h3>
<p>At first I thought about querying the data itself to find what&#8217;s missing. This made my head hurt a bit, and seemed pretty expensive.</p>
<p>I thought about the fact that many data warehouse databases have calendar tables, where all sorts of information about months, days, years, hours, and minutes are normalized out into tables.</p>
<p>However, I didn&#8217;t have those types of tables around. For the scope of my problem I was dealing with short date ranges (&lt;b&gt;and by short, I mean 3 hours)&lt;/b&gt; , and ideally I would not need to create a bunch of ancillary objects to fill in the gaps.</p>
<p>After some thinking, I realized that we can create a date time table at the minute level on the fly by using a recursive CTE.</p>
<p>Here&#8217;s a sample that counts out a few minutes:</p>
<p><pre class="brush: sql;">
WITH    MyCTE
          AS ( SELECT   CAST('2010-12-01 00:00:00' AS DATETIME2(0)) AS [I can count!]
               UNION ALL
               SELECT   DATEADD(mi, 1, [I can count!])
               FROM     MyCTE
               WHERE    [I can count!] &lt; DATEADD(mi, -1,
                                            CAST('2010-12-01 00:10:00' AS DATETIME2(0))) )
    SELECT  [I can count!]
    FROM    MyCTE
OPTION  ( MAXRECURSION 0 ) ;
</pre></p>
<p>Our results:<br />
<img class="alignnone size-full wp-image-1441" title="ICanCount" src="http://thedbaknows.files.wordpress.com/2010/12/icancount.jpg?w=154&#038;h=236" alt="" width="154" height="236" /></p>
<h3>Putting it all together</h3>
<p>Taking the format of this CTE, we can change it to create a table with every minute in our time range.</p>
<p>We can then select from it and use a LEFT OUTER JOIN to our table with data, and use the CTE dates to fill in the gaps.</p>
<p><pre class="brush: sql;">

DECLARE @startDate DATETIME2(0) ,
    @endDate DATETIME2(0) ;

SELECT  @startdate = MIN(ItemDate), @endDate = MAX(ItemDate)
FROM    dbo.MyImperfectData ;

WITH    MyCTE
          AS ( SELECT   @startDate AS MyCTEDate
               UNION ALL
               SELECT   DATEADD(mi, 1, MyCTEDate)
               FROM     MyCTE
               WHERE    MyCTEDate &lt; DATEADD(mi, -1, @endDate) )
    SELECT  MyCTEDate, CASE WHEN Itemcount IS NULL THEN '[Missing Row]'
                            ELSE ''
                       END AS ColumnDescription,
            COALESCE(ItemCount, 0) AS ItemCount
    FROM    MyCTE
            LEFT OUTER JOIN dbo.MyImperfectData ld
                ON MyCTE.MyCTEDate = ld.ItemDate
    ORDER BY MyCTEDate
OPTION  ( MAXRECURSION 0 ) ;

</pre></p>
<p>And there we have it! No gaps:</p>
<div id="attachment_1444" class="wp-caption alignnone" style="width: 335px"><img class="size-full wp-image-1444" title="NoGaps" src="http://thedbaknows.files.wordpress.com/2010/12/nogaps1.jpg?w=325&#038;h=592" alt="" width="325" height="592" /><p class="wp-caption-text">No gaps allowed.</p></div>
<h3>Use Cases</h3>
<p>Check out the comments! In my initial posting, I didn&#8217;t say enough about where this is best applied, and how this scales.</p>
<p>I think this is <em>mostly</em> a party trick, but it&#8217;s also a nice simple example of recursion that got me thinking about CTEs.  And while there are some situations where it can come in useful, it doesn&#8217;t scale up to large date ranges. (Check out Brad Schulz&#8217; post on <a href="http://bradsruminations.blogspot.com/2010/03/this-article-on-recurson-is-entitled.html" target="_blank">recursive CTEs here</a>.)</p>
<p>So in other words, this may be helpful in some ad-hoc situations.</p>
<p>However, looking at the &#8220;pseudo-recursive&#8221; parts of Brad&#8217;s post, I really feel a follow-up post or two coming on.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1426&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/23/mindthegap/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/imuttoo_389666319_f45d439bde.jpg?w=300" medium="image">
			<media:title type="html">MindTheGap</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/icancount.jpg" medium="image">
			<media:title type="html">ICanCount</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/nogaps1.jpg" medium="image">
			<media:title type="html">NoGaps</media:title>
		</media:content>
	</item>
		<item>
		<title>The 9th Day of SQL: Things Aren&#8217;t as Simple as They Seem</title>
		<link>http://thedbaknows.wordpress.com/2010/12/21/9thdayofsql/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/21/9thdayofsql/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 14:10:34 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Execution Plans]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[@SQLKiwi]]></category>
		<category><![CDATA[Paul White]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1391</guid>
		<description><![CDATA[The 12 days of SQL Brent Ozar (blog &#124; twitter) had an idea: a group of people should blog about writing which they&#8217;ve loved this year by people in the SQL community. For each &#8220;day of SQL,&#8221; someone picks a blog which they thought was great and writes about it. Yesterday was Day 8, when Karen Lopez talked [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1391&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>The 12 days of SQL</h3>
<p>Brent Ozar (<a href="http://www.brentozar.com/" target="_blank">blog</a> | <a href="http://twitter.com/#!/brento" target="_blank">twitter</a>) had an idea: a group of people should blog about writing which they&#8217;ve loved this year by people in the SQL community. For each &#8220;day of SQL,&#8221; someone picks a blog which they thought was great and writes about it.</p>
<p>Yesterday was Day 8, when <a href="http://blog.infoadvisors.com/index.php/2010/12/20/12-days-of-sql-what-is-your-under-over/">Karen Lopez talked about a post by Louis Davidson</a> and asked &#8220;What is your over/under?&#8221;  Karen is a great speaker, an inspiring writer, and just an incredibly interesting person. Check out her post!</p>
<div id="attachment_1396" class="wp-caption alignright" style="width: 169px"><a href="http://www.flickr.com/photos/dirvish/3130724849/sizes/m/in/photostream/"><img class="size-medium wp-image-1396 " title="dirvish_3130724849_33c012b522" src="http://thedbaknows.files.wordpress.com/2010/12/dirvish_3130724849_33c012b522.jpg?w=159&#038;h=240" alt="" width="159" height="240" /></a><p class="wp-caption-text">On the 9th Day of SQL the engine gave to me: Something a little different than I expected.</p></div>
<h3>Day 9: The Day of Paul White</h3>
<p>This day of SQL is not about nine ladies dancing. (Sorry Karen!) Instead, it&#8217;s devoted to one New Zealander writing: his name is Paul White (<a href="http://sqlblog.com/blogs/paul_white/default.aspx" target="_blank">blog</a> | <a href="http://twitter.com/#!/SQL_Kiwi" target="_blank">twitter</a>).</p>
<p>First off, let me say that Paul White&#8217;s blog, &#8220;Page Free Space,&#8221; is just plain awesome. When I see Paul&#8217;s written a new post I know to allocate some time for it and read it through slowly, and that I should expect to have to think about what I&#8217;m reading to understand it.</p>
<p>I swear I can sometimes feel things moving around in my head when I read Paul&#8217;s posts. Apply the warning about overhead bins during flight: be careful, contents may shift while you&#8217;re reading Paul White&#8217;s blog.</p>
<h3>So What&#8217;s My Favorite Post of the Year?</h3>
<p>I picked Paul&#8217;s post, <a href="http://sqlblog.com/blogs/paul_white/archive/2010/11/01/read-committed-shared-locks-and-rollbacks.aspx">The Case of the Missing Shared Locks</a>.</p>
<p>There&#8217;s a lot to love about this post. It is a great demonstration that <em>things aren&#8217;t as simple as they seem.</em></p>
<p>Paul starts the post with the question:</p>
<blockquote><p>If I hold an exclusive lock on a row, can another transaction running at the default read committed isolation level read it?</p></blockquote>
<p>The answer to that would seem fairly straightforward. But in fact, things are pretty complicated. However, if you go through it slowly and really look at the examples, it can help you understand a lot about locking.</p>
<p>This is good.</p>
<h3>Why is it Good that Things Are So Complicated? It&#8217;s CONFUSING.</h3>
<p>Have you ever said something along these lines? &#8220;I&#8217;d like to give a presentation sometime, but I don&#8217;t have anything to talk about.&#8221;</p>
<p>Or, &#8220;I&#8217;m not sure that I have anything that interesting to fill a whole hour.&#8221;</p>
<p>Well, take a look at Paul&#8217;s post. He took something small, and he looked very closely at it. He played with it a couple of different ways, and he worked on it to see how it behaved. He stepped through it in a series of short, straightforward steps.</p>
<p>You can do the same thing with many things you&#8217;re familiar with. You can take a topic, or a feature, or a method of doing something and distill it into an interesting question. You can then look closely at the question and work with it carefully. Use it as a chance to explore something. You&#8217;re probably familiar with it, but by taking the time to write about it or present it, you&#8217;ll have the opportunity to get to know it better than you <em>ever</em> thought you could.</p>
<p><span style="font-size:15px;font-weight:bold;">Who&#8217;s Next?</span></p>
<p>I&#8217;m handing the dreidl off to Crys Manson (<a href="http://crysmanson.com/">blog</a> | <a href="http://twitter.com/#!/@crysmanson">twitter</a>) for Day 10.</p>
<p>Crys is a seriously great DBA, a fantastic friend, and she sometimes makes me snort liquid through my nose laughing.</p>
<p>Tag, Crys, you&#8217;re it!</p>
<h3>How&#8217;d We Get Here?</h3>
<p>If you want to check out where we&#8217;ve been so far, we&#8217;ve had:</p>
<ul>
<li>Brent O&#8217;s <a href="http://www.brentozar.com/archive/2010/12/twelve-days-of-sql-series/">12 Days of SQL</a> post</li>
<li>Day1: <a href="http://facility9.com/2010/12/09/twelve-days-of-sql-day-2">Jeremiah Peschka</a></li>
<li>Day 2: <a href="http://scarydba.com/2010/12/10/12-days-of-sql-on-the-2nd-day-of-sql/">Grant Fritchey</a></li>
<li>Day 3: <a href="http://www.made2mentor.com/2010/12/on-the-third-day-of-sq/" target="_blank">Dave Stein</a></li>
<li>Day 4: <a href="http://sqlblog.com/blogs/andy_leonard/archive/2010/12/14/on-the-fourth-day-of-the-sql-series.aspx">Andy Leonard</a></li>
<li>Day 5: <a href="http://www.erinstellato.com/index.php/component/content/article/1-latest-news/111-on-the-fifth-day-of-sql">Erin Stellato</a></li>
<li>Day 6: <a href="http://thesqlagentman.com/2010/12/12-days-of-sql-on-the-6th-day-of-sql%E2%80%A6/">Tim Ford</a></li>
<li>Day 7: <a href="http://sqlscribbles.com/archive/2010/12/on-the-7th-day-of-sql/" target="_blank">Yanni Robel</a></li>
<li>Day 8: <a href="http://blog.infoadvisors.com/index.php/2010/12/20/12-days-of-sql-what-is-your-under-over/" target="_blank">Karen Lopez</a></li>
</ul>
<h3>A Little Present</h3>
<p>You don&#8217;t need to be Jewish for this to be your favorite holiday song this year. Rock  on with the Maccabeats, y&#8217;all. (You will need to click the &#8220;watch on YouTube&#8221; link.)</p>
<span style="text-align:center; display: block;"><a href="http://thedbaknows.wordpress.com/2010/12/21/9thdayofsql/"><img src="http://img.youtube.com/vi/qSJCSR4MuhU/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1391&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/21/9thdayofsql/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/dirvish_3130724849_33c012b522.jpg?w=199" medium="image">
			<media:title type="html">dirvish_3130724849_33c012b522</media:title>
		</media:content>
	</item>
		<item>
		<title>Select * from dbo.FAIL: invalid metadata in views and user defined functions</title>
		<link>http://thedbaknows.wordpress.com/2010/12/16/selectstar/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/16/selectstar/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 14:10:59 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1376</guid>
		<description><![CDATA[This week a question on the Twitter #sqlhelp hash tag reminded me of a detail of SQL Server that I learned the hard way, but forgot to blog about. The question was: For those without images enabled (you anarchic luddites), that&#8217;s &#8220;Is there a good reason to have a SQL view that is just select [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1376&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This week a question on the Twitter <a href="http://twitter.com/#!/search/%23sqlhelp">#sqlhelp hash tag</a> reminded me of a detail of SQL Server that I learned the hard way, but forgot to blog about. The question was:</p>
<div id="attachment_1379" class="wp-caption aligncenter" style="width: 310px"><a href="http://twitter.com/#!/mattmutz/status/13317634846105600"><img class="size-medium wp-image-1379 " title="sqlHelpSelectStarView" src="http://thedbaknows.files.wordpress.com/2010/12/sqlhelpselectstarview.png?w=300&#038;h=109" alt="" width="300" height="109" /></a><p class="wp-caption-text">SQLHelp in action</p></div>
<p>For those without images enabled (you anarchic luddites), that&#8217;s &#8220;Is there a good reason to have a SQL view that is just select * from a table with no filtering?&#8221;</p>
<h3>Why Shouldn&#8217;t You Do That?</h3>
<p>There are things you should know about how SQL Server handles metadata. When you update the schema for an underlying object (such as adding or removing a column in a table), the metadata for referencing objects is not automatically updated.</p>
<p>This can impact you <em>whether or not </em>you are using SELECT *. However it is far more likely to impact you, and to impact you more widely, when you have a practice of  using SELECT * in your object definitions for views, functions, etc.</p>
<h3>Once Upon a Time&#8230;</h3>
<p>There was a team of people working on optimizing their schema. Columns were being added and removed from several tables. The changes were checked in, tested, and handed off to operations for deployment. The operations DBA verified which changes were to replicated tables and validated that changes were approved by owners of subscriber systems. The change was put through pre-production and the change management system  appropriately.</p>
<p>Thirty minutes after the change went through to production, users of tools on a downstream system began to complain about large volumes of errors in the tool. It was discovered that many databases on the instance with the replication subscriber  had views and table valued functions referencing the article, using the &#8220;Select * syntax&#8221;. With the removal of the columns, literally hundreds of these views were returning 5402 errors, even though the users didn&#8217;t specifically need the columns which had been removed.</p>
<p>After the issue was identified, the operations team was able to resolve the incident by updating the metadata on the views and functions with the sp_refreshsqlmodule stored procedures.</p>
<p>For future schema changes to replicated tables, a script looping through all views and functions was used. This tended to be a bit problematic occasionally, as many users had longrunning queries using the impacted views and functions.</p>
<h3>Learn More</h3>
<p>To learn more, check out my sample script below, and also these MSDN articles on the stored procedures you use to update metadata:</p>
<ul>
<li>sp_refreshsqlmodule: <a href="http://msdn.microsoft.com/en-us/library/bb326754.aspx">http://msdn.microsoft.com/en-us/library/bb326754.aspx</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/bb326754.aspx"></a>sp_refreshview <a href="http://technet.microsoft.com/en-us/library/ms187821.aspx">http://technet.microsoft.com/en-us/library/ms187821.aspx</a></li>
</ul>
<p>Note that sp_refreshsqlmodule can also be used for views, so you likely want to just standardize with it.</p>
<p><span style="color:#ff0000;"><em>Remember</em></span>:</p>
<ul>
<li><strong>Check your replication subscrbiers</strong>: If you&#8217;re changing the schema of replicated objects, you may need to update metadata for referencing objects in your subscriber databases, and in other databases on all instances where objects may be referencing the tables by three part names.</li>
<li><strong>Prepare to be blocked</strong>: Your request to update metadata can and will be blocked by running processes using those objects. Make sure to plan for this and determine if and whether you should kill running processes or not to update the metadata.</li>
</ul>
<h3>Why Many People Don&#8217;t Know About This</h3>
<p>If you&#8217;re used to controlling  your data access with stored procedures or ORM tools such as nHibernate, it&#8217;s easy to never quite learn this detail, or to forget it.</p>
<p>Stored procedures won&#8217;t usually have this issues because they recompile after the schema is changed on the underlying object, which automatically refreshes their metadata.</p>
<h3>Alternatives</h3>
<p>If you need to reference an object by a different name, <a href="http://msdn.microsoft.com/en-us/library/ms177544.aspx">create a synonym</a>!</p>
<h3>Example Script: views, functions, sprocs, synonyms, and metadata.</h3>
<p>Here&#8217;s some sql code to walk through some basic examples of how this all behaves.</p>
<p>This script shows a simple example of how schema updates aren&#8217;t reflected in the metadata for views and table valued functions unless they are explicitly edited, and it also slows a basic example of a 5402 error.</p>
<p><pre class="brush: sql;">
--Create a base table for testing
create table dbo.LookAtMe (
	i int identity primary key,
	Msg nvarchar(128)
)
GO

--Add a row
insert dbo.LookAtMe (Msg) VALUES('Hi, how are you?')
GO

--Create a view looking at the table using select *
create view dbo.vImLookinAtYou AS
	SELECT *
	FROM dbo.LookAtMe
GO

--Create a table valued function looking at the table with select *
create function dbo.tvfImLookinAtYou ()
RETURNS TABLE
AS
RETURN
(
	SELECT *
	FROM dbo.LookAtMe
)
GO

--Create a procedure looking at the table with select *
create procedure dbo.prcImLookinAtYou
AS
	SELECT *
	FROM dbo.LookAtMe
GO

--create a synonym for dbo.LookAtMe
create synonym dbo.synImLookinAtYou
FOR dbo.LookAtMe

--Our view, function, and proc each return two columns, i and Msg
select * from dbo.vImLookinAtYou
GO
select * from dbo.tvfImLookinAtYou()
GO
exec dbo.prcImLookinAtYou
GO
select * from dbo.synImLookinAtYou
GO

--Now, let's add a column
alter table dbo.LookAtMe
add lookTime datetime
GO

--Our view and functions still work
--but they aren't returning the new column!
select * from dbo.vImLookinAtYou
GO
select * from dbo.tvfImLookinAtYou()
GO
--Our procedure, however does return the new column!
exec dbo.prcImLookinAtYou
GO
--Our synonym also lets us see the new column.
select * from dbo.synImLookinAtYou
GO

--Let's refresh the metadata for the view and function
exec sp_refreshview 'dbo.vImLookinAtYou'
GO
exec sp_refreshsqlmodule 'dbo.tvfImLookinAtYou'
GO

--Now we can see the new column in the view and function
select * from dbo.vImLookinAtYou
GO
select * from dbo.tvfImLookinAtYou()
GO

--Now let's remove a column from the table
alter table dbo.LookAtMe
drop column lookTime
GO

--Oh no!
--Our view and function both return error 4502:
--&quot;View or function ... has more column names specified than columns defined.&quot;
select * from dbo.vImLookinAtYou
GO
select * from dbo.tvfImLookinAtYou()
GO
--Our procedure is fine, though
exec dbo.prcImLookinAtYou
GO
--Our synonym is also fine. It's just a pointer.
select * from dbo.synImLookinAtYou
GO

--Let's refresh the metadata for the view and function.
exec sp_refreshview 'dbo.vImLookinAtYou'
GO
exec sp_refreshsqlmodule 'dbo.tvfImLookinAtYou'
GO

--Now they work again.
select * from dbo.vImLookinAtYou
GO
select * from dbo.tvfImLookinAtYou()
GO

--Clean up our objects
drop table dbo.LookAtMe
drop view dbo.vImLookinAtYou
drop procedure dbo.prcImLookinAtYou
drop function dbo.tvfImLookinAtYou
drop synonym dbo.synImLookinAtYou
GO
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1376&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/16/selectstar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/sqlhelpselectstarview.png?w=300" medium="image">
			<media:title type="html">sqlHelpSelectStarView</media:title>
		</media:content>
	</item>
		<item>
		<title>What the Business Wants: FEATURES (TSQL Tuesday #13)</title>
		<link>http://thedbaknows.wordpress.com/2010/12/14/whatthebusinesssays/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/14/whatthebusinesssays/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 14:30:43 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[#TSQL2sDay]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1410</guid>
		<description><![CDATA[It&#8217;s TSQL Tuesday Again&#8230; This month&#8217;s #tsql2sDay is hosted by Steve Jones (blog &#124; twitter), and the topic is &#8220;What the Business Says is Not What the Business Wants.&#8221; Steve asks the question: What issues have you had in interacting with the business to get your job done? I thought about this for a long time. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1410&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>It&#8217;s TSQL Tuesday Again&#8230;<a href="http://www.sqlservercentral.com/blogs/steve_jones/archive/2010/12/07/t_2D00_sql-tuesday-_2300_13-_2D00_-what-the-business-says-is-not-what-the-business-wants.aspx"><img class="alignright size-full wp-image-1413" title="TSQL2sDay150x150_thumb1" src="http://thedbaknows.files.wordpress.com/2010/12/tsql2sday150x150_thumb1.jpg?w=154&#038;h=154" alt="" width="154" height="154" /></a></h3>
<p>This month&#8217;s <a href="http://twitter.com/#search/%23tsql2sday">#tsql2sDay</a> is hosted by Steve Jones <a href="http://www.sqlservercentral.com/blogs/steve_jones/default.aspx">(blog</a> | <a href="http://twitter.com/#!/way0utwest">twitter</a>), and the topic is &#8220;<a href="http://www.sqlservercentral.com/blogs/steve_jones/archive/2010/12/07/t_2D00_sql-tuesday-_2300_13-_2D00_-what-the-business-says-is-not-what-the-business-wants.aspx">What the Business Says is Not What the Business Wants</a>.&#8221; Steve asks the question:</p>
<blockquote><p>What issues have you had in interacting with the business to get your job done?</p></blockquote>
<p>I thought about this for a long time. Eventually I realized that I wanted to see the pattern in the trees from the last ten years.</p>
<h3>What the Business Says: &#8220;We Want Features!&#8221;</h3>
<p>As a DBA working with software developers, I&#8217;ve heard many times from the business that they want new features.</p>
<p>They need a new feature to land a big client, to be the first to market with something, to retain a client, to compete with x.</p>
<p>They need a feature to land on Mars, and if we can&#8217;t do that reliably, well, we should just do that once. They don&#8217;t care what it takes to get to that feature, we needed to get it <em>last week</em>.</p>
<p>And so the wheels squeak, and the features are prioritized with a mysterious calculus involving the business which is never fully revealed.</p>
<p>But although I have seen that the business does not <em>always</em> dictate the priorities directly and fully, I have  often seen that the business dictates the timeline for what is prioritized. And that timeline is usually pretty quick.</p>
<h3>What the Business Wants: They Actually <em>Do</em> Want Features. They Just Don&#8217;t Want to Talk about Sacrificing Scalability/Availability/Recoverability for Speed of Delivery.</h3>
<p>The thing is, the business is telling the truth. They do need features to make money&#8211; at least in the competitive markets I&#8217;ve worked in.</p>
<div id="attachment_1422" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/dawnzy/287308727/sizes/s/"><img class="size-full wp-image-1422" title="dawnyz_287308727_ddb4638cd4_m" src="http://thedbaknows.files.wordpress.com/2010/12/dawnyz_287308727_ddb4638cd4_m.jpg?w=240&#038;h=192" alt="" width="240" height="192" /></a><p class="wp-caption-text">The Scalability Fairy sadly doesn&#039;t show up nightly when your application loses a tooth. Or a customer.</p></div>
<p>However, typically people are so busy stressing when they need the new features that no honest assessment and agreement on quality is reached.</p>
<p>Maybe people think it&#8217;s embarrassing to have a frank discussion about what type of SLA and reliability will come with a new feature. Possibly that opens a company to some legal challenges if a different level of service has been provided to the customer. However, this is exactly what the business should truly want: to promise the correct level of reliability to the customer.</p>
<p>Now, not all new features need to be high quality work. Sometimes you&#8217;re delivering a shiny toy, and nobody&#8217;s going to use it to shave, wear it as a diaper, or drive it to work. But a feature needs to have a clearly defined level of scalability and it needs to be safety-proofed to the appropriate level for that product. It shouldn&#8217;t enrage your large customers on a regular basis.</p>
<p>Commonly, this part of the process is overlooked. People don&#8217;t want to talk about it. Unfortunately, it leads to delivering a product that  may look good at first on the outside, but may not really please the customer until it&#8217;s been patched up in the middle of the night a few times, retrofitted on a weekend, and ultimately largely re-written and re-released.</p>
<h3>So, What Do you Do?</h3>
<p>As an operations person, you bring up the conversation about SLAs repeatedly and make sure all parties come to an agreement. You ask questions about disaster recovery and availability and make sure you have the time and resources to meet those needs.</p>
<p>You make sure there&#8217;s time in the release schedule for performance and load testing, and  you set your expectations to medium-low until you have strong data that shows how something will perform. Trickiest of all: you somehow get that data prior to release.</p>
<p>You document everything, because people won&#8217;t remember later.</p>
<p>But most of all, you establish a good relationship with people in the business by being genuine, open, and honest with them, and not pre-judging them. If your business people trust you, they are likely to ask you a few questions before making many promises.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1410/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1410&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/14/whatthebusinesssays/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/tsql2sday150x150_thumb1.jpg" medium="image">
			<media:title type="html">TSQL2sDay150x150_thumb1</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/dawnyz_287308727_ddb4638cd4_m.jpg" medium="image">
			<media:title type="html">dawnyz_287308727_ddb4638cd4_m</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction to Partitioning: Resources!</title>
		<link>http://thedbaknows.wordpress.com/2010/12/07/intropartitionin/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/07/intropartitionin/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 14:21:16 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[SQL Features]]></category>
		<category><![CDATA[SQLServerPedia Syndication]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1358</guid>
		<description><![CDATA[This past Saturday I presented my shiny new Introduction to SQL Server Partitioning session at SQL Saturday 61. There were two separate sessions scheduled for partitioning that day, but the room was still full&#8211; thanks everyone for coming to learn about how, why, and when you might use this feature. Slides, Links and Scripts My [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1358&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This past Saturday I presented my <em>shiny new</em> Introduction to SQL Server Partitioning session at <a href="http://sqlsaturday.com/61/schedule.aspx">SQL Saturday 61</a>.</p>
<p>There were two separate sessions scheduled for partitioning that day, but the room was still full&#8211; thanks everyone for coming to learn about how, why, and when you might use this feature.</p>
<h3>Slides, Links and Scripts</h3>
<p>My slide deck, <a href="http://thedbaknows.files.wordpress.com/2010/12/partitioning_kendralittle.pptx">Introduction to SQL Server Partitioning</a>, is available for download.</p>
<p>Links to all sorts of resources about partitioning <strong>and</strong> my simple partitioning demo script are available here:<br />
<a href="http://littlekendra.com/resources/partition/">http://littlekendra.com/resources/partition/</a></p>
<h3>Whose Doll is That?</h3>
<p>My partitioning slide deck features a lovely assistant who is sawed into partitions, and also offers pieces of advice.</p>
<p>This little beauty was found on Flickr and is the fine work of <a href="http://www.flickr.com/photos/lara604/3163793777">Lara604</a>.</p>
<div id="attachment_1362" class="wp-caption alignleft" style="width: 190px"><a href="http://www.flickr.com/photos/lara604/3163793777/sizes/l/"><img class="size-medium wp-image-1362  " title="lara604_3163793777" src="http://thedbaknows.files.wordpress.com/2010/12/lara604_3163793777_transparent_partitioned2.gif?w=180&#038;h=164" alt="" width="180" height="164" /></a><p class="wp-caption-text">Cheerfully Demonstrating Partitioning of the Head</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1358/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1358&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/07/intropartitionin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/12/lara604_3163793777_transparent_partitioned2.gif?w=300" medium="image">
			<media:title type="html">lara604_3163793777</media:title>
		</media:content>
	</item>
		<item>
		<title>Review: A day of doing many things at once with @AdamMachanic</title>
		<link>http://thedbaknows.wordpress.com/2010/12/03/manythingsreview/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/03/manythingsreview/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 14:00:56 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[SQL PASS]]></category>
		<category><![CDATA[adam machanic]]></category>
		<category><![CDATA[parallism]]></category>
		<category><![CDATA[precon]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[training]]></category>

		<guid isPermaLink="false">http://littlekendra.com/?p=1272</guid>
		<description><![CDATA[A day of doing many things At SQLPass this year I was fortunate to attend &#8220;A day of doing many things at once: Multitasking, Parallelism, and Process distribution&#8221; by Adam Machanic (blog &#124; twitter). This was a day long post-conference. So, how was it? This was a fantastic seminar. There was a really good flow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1272&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3 style="clear:both;"><img class="alignright size-medium wp-image-1312" style="display:inline;margin:0 10px 10px 0;" title="parallelism" src="http://thedbaknows.files.wordpress.com/2010/11/parallelism_v4.jpg?w=240&#038;h=174" alt="Parallel Puppy Operations" width="240" height="174" align="left" />A day of doing many things</h3>
<p>At SQLPass this year I was fortunate to attend &#8220;A day of doing many things at once: Multitasking, Parallelism, and Process distribution&#8221; by Adam Machanic (<a href="http://sqlblog.com/blogs/adam_machanic/" target="_blank">blog</a> | <a href="twitter.com/AdamMachanic" target="_blank">twitter</a>). This was a day long post-conference.</p>
<h3>So, how was it?</h3>
<p>This was a fantastic seminar. There was a really good flow to the talk, which started in CPU background and architecture, then moved through Windows Internals, SQL Server internals, and on to specifics of parallelism in queries. Then we finally moved on to administration topics, as well as different methods of process distribution. A full outline of the day <a href="http://sqlblog.com/blogs/adam_machanic/archive/2010/08/04/pass-summit-2010-post-conference-seminar-on-parallel-processing.aspx" target="_blank">is here</a>.</p>
<p>I think the presentation worked very well because of the balance of theory and practice. Essentially, there was a very good ratio between &#8216;what, &#8216;why&#8217;, and &#8216;how&#8217;.</p>
<p>I&#8217;ll look back at the outline for this seminar when designing longer presentations myself.</p>
<h3>Did I learn anything useful?</h3>
<p>Yes! The information on plan shapes and tricks to manipulate them was incredibly interesting, and is something I know will be useful. I also learned some interesting specifics about how the DAC works, and have a much more holistic view of how SQL Server uses processors and parallelism. Check out my tweets below for a little more insight into what my day was like!</p>
<h3>Free webcasts. Yep, free.</h3>
<p>Adam has some webcasts on parallelism <a href="http://sqlblog.com/blogs/adam_machanic/archive/2010/10/07/recent-webcasts-on-parallel-processing-available-for-download.aspx" target="_blank">available for download</a> which you can watch for free.</p>
<h3 style="clear:both;">My tweetstream from the session&#8230;</h3>
<p style="clear:both;">Here&#8217;s what my day was like, according to Twitter.</p>
<ul style="clear:both;">
<li>Postcon fun with @AdamMachanic today! #sqlpass Processes do not run, *threads* do.</li>
<li>Quick discussion of fiber mode for SQL Server: very limiting (http://bit.ly/bn6RoK)</li>
<li>Thread starvation: pre-emption by high priority threads can prevent some threads from ever running.</li>
<li>Threads running on client OS get a smaller amount of quantum units than on a server os (more frequent interrupt frequency)</li>
<li>Three types of processor affinity: none, hard affinity, and ideal affinity</li>
<li>Lots of love for sysinternals (http://bit.ly/WPxha) and theCPU-Z tool (w/ props to @BrentO for recommending http://bit.ly/1iBcg6)</li>
<li>Interrupt counts include not just when a quantum expires, but also when a thread finishes.</li>
<li>Lots of cool WMI queries being run from inside SSMS</li>
<li>Mine is still getting even better <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  RT @whimsql: Amen Tom! RT @SQLRockstar Best. Summit. Ever.</li>
<li>Meeting the SQLOS! It&#8217;s a &#8220;cooperative&#8221; scheduling system: everyone&#8217;s equal</li>
<li>SQLOS provides an abstraction layer so storage engine, qp, etc can all talk to it instead of directly to the OS</li>
<li>Proc Affinity at sql server level may be worth testing w/ multi instances. WIth virtualization taking predominance, is less common.</li>
<li>Differences between resource waits and signal waits being explained</li>
<li>484 Wait types in SQL Server 2008&#8211; plug for #sqlhelp hash tag for those with limited documentation.</li>
<li>I totally just got called on in a &#8220;what feature uses a hidden scheduler&#8221; Pop Quiz. #FAIL</li>
<li>@PaulRandal yep, we were all &#8220;so THAAAAAAAT&#8217;S how that works.&#8221;</li>
<li>Don&#8217;t think of operators in QPs as being parallelized. Think more of each set of rows as being prallelized.</li>
<li>Very few iterators are actually parallel-aware. Most do not need to be, even if being used by parallel streams.</li>
<li>OH: &#8220;I trust myself, but I don&#8217;t know if you should.&#8221; &lt;&#8211; always an appropriate comment when referring to production environment</li>
<li>And now we return to our discussion of the &#8220;Big O&#8221; and the Query Processor.</li>
<li>We just covered tempdb spills and @crysmanson &#8216;s old enemy, the resource_semaphore wait type.</li>
<li>Few outer rows demo showing repartitioning scheme and rows redistributed on threads&#8211; very cool</li>
<li>Verrrrrrry interesting stuff with CROSS APPLY and parallelism</li>
<li>Cost threshold for parallelism default is still what it was set originally in 7.5, for many contemporary systems it may be too low.</li>
<li>And that makes me happy to hear since we do raise the default cost threshold for parallelism on our prod servers <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>@AdamMachanic just actually turned it up to 11.</li>
<li>If you hit THREADPOOL waits, don&#8217;t just up the max worker threads permanently, find the root cause for the situation.</li>
<li>Finishing up with a monitoring parallelism section &#8212; really nice flow to the talk today!</li>
<li>Piles o&#8217; DMV fun, including the reason sys.dm_exec_requests has some funkiness: it shows wait state only for the root task</li>
<li>@AdamMachanic is demoing how sp_whoisactive will display your wait types, find your tempdb contention, and wash your dishes.</li>
<li>Demo of manipulating memory grants to cause a query to spill to tempdb purposefully&#8230; we&#8217;re not in kansas anymore.</li>
<li>@TheSQLGuru I&#8217;ve enjoyed it a ton&#8211; great combo of really interesting demos and information.</li>
</ul>
<p><br class="final-break" style="clear:both;" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1272/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1272/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1272/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1272&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/03/manythingsreview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>

		<media:content url="http://thedbaknows.files.wordpress.com/2010/11/parallelism_v4.jpg?w=300" medium="image">
			<media:title type="html">parallelism</media:title>
		</media:content>
	</item>
		<item>
		<title>The Next 24 Hours of PASS Event: Announcement and Call for Presenters</title>
		<link>http://thedbaknows.wordpress.com/2010/12/02/the-next-24-hours-of-pass-event-announcement-and-call-for-presenters/</link>
		<comments>http://thedbaknows.wordpress.com/2010/12/02/the-next-24-hours-of-pass-event-announcement-and-call-for-presenters/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 13:00:59 +0000</pubDate>
		<dc:creator>Kendra Little</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[SQL Community]]></category>
		<category><![CDATA[SQL PASS]]></category>
		<category><![CDATA[24HOP]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[sql Community]]></category>
		<category><![CDATA[SQLPASS]]></category>

		<guid isPermaLink="false">https://thedbaknows.wordpress.com/?p=1345</guid>
		<description><![CDATA[Tonight I checked in on the Twitterverse and saw that Jason Strate announced a new blog post about the next 24 Hours of Pass event. This time #24HOP is looking for presenters! Check this out: &#8230;the next 24 Hours of PASS will feature 24 women speakers speaking on SQL Server. The 24 women speakers haven’t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1345&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="clear:both;">Tonight I checked in on the Twitterverse and saw that <a href="http://twitter.com/StrateSQL/statuses/10211458293964800">Jason Strate announced a new blog post</a> about the next 24 Hours of Pass event.</p>
<p style="clear:both;">This time #24HOP is looking for presenters! Check this out:</p>
<blockquote style="clear:both;">
<p style="clear:both;">&#8230;the next 24 Hours of PASS will feature 24 women speakers speaking on SQL Server. The 24 women speakers haven’t been selected yet. In fact, if you happen to have and abstract in mind or know of a speaker that should speak, send an e-mail over to24hours@sqlpass.org. The deadline for abstracts submissions (max 250 words with a 125 word bio) is January 14th.</p>
</blockquote>
<p style="clear:both;">The event will occur during March, which is Women&#8217;s History Month.</p>
<p style="clear:both;">In the past I haven&#8217;t seen a call for speakers for #24HOP, so this is quite a change.</p>
<h3 style="clear:both;">Suggest Someone, or Yourself!</h3>
<p style="clear:both;">I know some women I&#8217;ll be suggesting for the event. Will yours be the same, or different?</p>
<p style="clear:both;">Read Jason&#8217;s full post <a href="http://www.jasonstrate.com/index.php/2010/12/the-next-24-hours-of-pass">here</a>.</p>
<p><br class="final-break" style="clear:both;" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedbaknows.wordpress.com/1345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedbaknows.wordpress.com/1345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedbaknows.wordpress.com/1345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedbaknows.wordpress.com/1345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedbaknows.wordpress.com/1345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedbaknows.wordpress.com/1345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedbaknows.wordpress.com/1345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedbaknows.wordpress.com/1345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedbaknows.wordpress.com&amp;blog=7406394&amp;post=1345&amp;subd=thedbaknows&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedbaknows.wordpress.com/2010/12/02/the-next-24-hours-of-pass-event-announcement-and-call-for-presenters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4262014869b598bdd8b9f03b9c47d9b?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">thedbaknowswhatyoudid</media:title>
		</media:content>
	</item>
	</channel>
</rss>
