<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns: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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Matt Velic</title>
	
	<link>http://mattvelic.com</link>
	<description>Data and Design</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:31:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MattVelic" /><feedburner:info uri="mattvelic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/MattVelic" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FMattVelic" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>Link: Ship It Quickly</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/-f0CojRNEeo/</link>
		<comments>http://mattvelic.com/link-ship-it-quickly/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 22:31:39 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Interesting Stuff]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[entrepreneur]]></category>
		<category><![CDATA[WebApps]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=450</guid>
		<description><![CDATA[Very awesome story from an awesome lady about her experiences in launching her first web application.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.limedaring.com/im-a-designer-who-learned-django-and-launched-her-first-webapp-in-6-weeks/" title="Read I'm a Designer who Learned Django and Launched her first webapp in 6 Weeks">Very awesome story from an awesome lady about her experiences in launching her first web application.</a></p>
<div class="shr-publisher-450"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/-f0CojRNEeo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/link-ship-it-quickly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattvelic.com/link-ship-it-quickly/</feedburner:origLink></item>
		<item>
		<title>Link: Apple, Manufacturing, Jobs (not Steve, mostly)</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/u_WfdiiRQ80/</link>
		<comments>http://mattvelic.com/link-apple-manufacturing-jobs/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 17:33:32 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Interesting Stuff]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Manufacturing]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=448</guid>
		<description><![CDATA[New York Times article revealing the foreign manufacturing operation behind Apple, and some reasons why those jobs may never come back to the United States.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nytimes.com/2012/01/22/business/apple-america-and-a-squeezed-middle-class.html?_r=4&#038;pagewanted=all" title="Read How the U.S. Lost Out on iPhone Work">New York Times article revealing the foreign manufacturing operation behind Apple, and some reasons why those jobs may never come back to the United States.</a></p>
<div class="shr-publisher-448"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/u_WfdiiRQ80" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/link-apple-manufacturing-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattvelic.com/link-apple-manufacturing-jobs/</feedburner:origLink></item>
		<item>
		<title>SELECT * FROM ZipLock</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/Z5IP2Bf7irM/</link>
		<comments>http://mattvelic.com/select-from-ziplock/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:00:26 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Query Writing]]></category>
		<category><![CDATA[Select *]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=446</guid>
		<description><![CDATA[I saw this commercial a while ago, but found a copy of it on YouTube only recently. (Thankfully Congress dropped SOPA/PIPA, so I feel safe sharing it&#8230;) Anyway, this is a bit how it&#8217;s like when writing a query with &#8230; <a href="http://mattvelic.com/select-from-ziplock/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I saw this commercial a while ago, but found a copy of it on YouTube only recently. (Thankfully Congress dropped SOPA/PIPA, so I feel safe sharing it&#8230;) Anyway, this is a bit how it&#8217;s like when writing a query with SELECT *. We don&#8217;t have the convenience of a plastic bag to save the unused data from an errant query, so show responsibility and add the columns you really need.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/GBHU3M_abDo" frameborder="0" allowfullscreen></iframe></p>
<div class="shr-publisher-446"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/Z5IP2Bf7irM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/select-from-ziplock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattvelic.com/select-from-ziplock/</feedburner:origLink></item>
		<item>
		<title>Let’s Get Recursive!</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/Qnjciyzq5oE/</link>
		<comments>http://mattvelic.com/lets-get-recursive/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 14:00:37 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[CTE]]></category>
		<category><![CDATA[Recursive CTE]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=437</guid>
		<description><![CDATA[Recently I was asked about how I might show relationships between different entities within the same table. That one object might be the parent of another, and the child might have children or grandchildren of its own. To date, the &#8230; <a href="http://mattvelic.com/lets-get-recursive/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked about how I might show relationships between different entities within the same table. That one object might be the parent of another, and the child might have children or grandchildren of its own. To date, the person making the inquiry had been using a secondary table in order to work out these relationships, but he thought that there was probably a better way.</p>
<p>I replied, &#8220;You are absolutely right that there is a better way: you can use Recursive <abbr title="Common Table Expression">CTE</abbr>s!&#8221;</p>
<h3>The CTE, Recursed</h3>
<p><a href="http://msdn.microsoft.com/en-us/library/ms190766.aspx" title="Read Using Common Table Expressions">To quote SQL Server Books Online</a>, &#8220;A common table expression (CTE) can be thought of as a temporary result set that is defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW statement.&#8221; So what makes a CTE recursive? It references itself over and over, building subsets until it has returned the whole results set. A bit of a warning: you can only use CTEs with SQL Server 2005 or later.</p>
<p>To start, let&#8217;s use TempDB and create some data so we can play. We&#8217;re creating a single table, dbo.Family, and it is self-referencing in that both Parents and Children are stored inside of it. You can tell the top-most Parent when a row doesn&#8217;t have an ID listed in the ParentID field. If it does, it means that the row is the child of another, and the ID listed is the Parent&#8217;s MainID. (I know, it&#8217;s not at all confusing.) Once you create the table and populate the data, you can run the SELECT statement and see the normal output.</p>
<pre type="syntaxhighlighter" class="brush: sql">
USE tempdb;
GO

CREATE TABLE dbo.Family (
	MainID INT NOT NULL IDENTITY PRIMARY KEY
	,ParentID INT NULL
	,Name VARCHAR(35) NOT NULL
);

ALTER TABLE dbo.Family
ADD CONSTRAINT FK_ParentChild FOREIGN KEY (ParentID)
	REFERENCES dbo.Family (MainID);
GO

INSERT INTO dbo.Family (ParentID, Name)
VALUES (NULL,'Parent A')
,(1,'Child A')
,(2,'Grandchild A1')
,(2,'Grandchild A2')
,(NULL,'Parent B')
,(NULL,'Parent C')
,(5,'Child B1')
,(6,'Child C')
,(5,'Child B2')
,(8,'Grandchild C')
,(10,'Great-Grandchild C');
GO

SELECT MainID, ParentID, Name
FROM dbo.Family;
</pre>
<div id="attachment_445" class="wp-caption aligncenter" style="width: 259px"><a href="http://mattvelic.com/wp-content/uploads/2012/01/reCTE_Basic_Set.png"><img src="http://mattvelic.com/wp-content/uploads/2012/01/reCTE_Basic_Set.png" alt="A basic SELECT statement result set." title="reCTE_Basic_Set" width="249" height="253" class="size-full wp-image-445" /></a><p class="wp-caption-text">SELECT * FROM dbo.Family</p></div>
<h3>The Boring Syntax Part</h3>
<p>As you&#8217;ll see in the examples below, the CTE part of the query is the SELECT statement wrapped in parathesis and setting on top of the normal SELECT statement. This simple query must begin with the keyword WITH, and then you&#8217;d name your CTE. I&#8217;ve named mine reCTE. Another warning: because of the keyword WITH, all previous statements must be closed with a semi-colon (;). You may often see others write their CTEs as &#8220;;WITH reCTE&#8221; with the semi-colon preceding the keyword. It&#8217;s a safety measure as the whole query will fail if the previous statement hasn&#8217;t been closed yet. Additionally, I like to include explicit column names, though you don&#8217;t have to.</p>
<p>As for the CTE, it is your basic SELECT statement. It&#8217;s used to build the temporary set that the final SELECT statement can use; it&#8217;s similar to using a temp table. To make a CTE recursive, you simply add a UNION ALL. When using UNION ALL, the number of columns must be equal between the two sets, and they must be in the same order and share the same data type in order for the UNION to function properly.</p>
<p>As you&#8217;ll see in the example queries below, the first SELECT query is called the Anchor Member. It returns a valid table that&#8217;s used as the basis of the recursion. The query that follows the UNION ALL is termed the Recursive Member. It&#8217;s the query that is run against the anchor until the complete set has been returned.</p>
<h3>Power of Recursion</h3>
<p>As before, this functionality is available to users of SQL Server 2005 and later. What about the times before SQL 2005? Well, you had to rely on some seconday table in order to recurse through a results set. Using CTEs, you can encapsulate this within a single query. One common request is to see how &#8220;deep&#8221; a family is. This might come in the guise of managers to subordinates in displaying how flat (or deep) an organizational chart is.</p>
<pre type="syntaxhighlighter" class="brush: sql">
WITH reCTE (MainID, ParentID, Name, Depth) AS (
	--Anchor Member
	SELECT f.MainID, f.ParentID, f.Name, 1 AS Depth
	FROM dbo.Family as f
	WHERE f.ParentID IS NULL
	UNION ALL
	--Recursive Member
	SELECT f.MainID, f.ParentID, f.Name, Depth + 1
	FROM dbo.Family as f
	INNER JOIN reCTE
		ON f.ParentID = reCTE.MainID
)
SELECT reCTE.MainID, reCTE.ParentID, reCTE.Name, reCTE.Depth
FROM reCTE
ORDER BY reCTE.Depth, reCTE.MainID;
</pre>
<div id="attachment_439" class="wp-caption aligncenter" style="width: 301px"><a href="http://mattvelic.com/wp-content/uploads/2012/01/reCTE_Depth.png"><img src="http://mattvelic.com/wp-content/uploads/2012/01/reCTE_Depth.png" alt="Result set from a recursive CTE query showing the overall depth between the absolute Parent records and the lowest Child records." title="reCTE_Depth" width="291" height="253" class="size-full wp-image-439" /></a><p class="wp-caption-text">How Low Can You Go?</p></div>
<p>As above, the Anchor Member is used to set the basic result. In this case, we&#8217;re querying for the absolute Parents in the set. The Recursive Member follows the UNION ALL, and we actually reference the CTE in a JOIN while still defining reCTE as a whole. This is what makes it recursive.</p>
<p>The outer query returns the set we&#8217;ve created with the CTE. For the above set, there are four levels of depth. This could translate to an organizational chart, or in discovering one&#8217;s secondary and tertiary managers.</p>
<p>Another common use for the recursive CTE is to find all relationships to a single Parent. With a little modification, we can use nearly the same query but aim for finding all the subordinates to Parent A by changing the WHERE clause in our Anchor to a specific MainID.</p>
<pre type="syntaxhighlighter" class="brush: sql">
WITH reCTE (MainID, ParentID, Name) AS (
	--Anchor Member
	SELECT f.MainID, f.ParentID, f.Name
	FROM dbo.Family as f
	WHERE f.MainID = 1
	UNION ALL
	--Recursive Member
	SELECT f.MainID, f.ParentID, f.Name
	FROM dbo.Family as f
	INNER JOIN reCTE
		ON f.ParentID = reCTE.MainID
)
SELECT reCTE.MainID, reCTE.ParentID, reCTE.Name
FROM reCTE
ORDER BY reCTE.MainID;
</pre>
<div id="attachment_444" class="wp-caption aligncenter" style="width: 236px"><a href="http://mattvelic.com/wp-content/uploads/2012/01/reCTE_Lineage.png"><img src="http://mattvelic.com/wp-content/uploads/2012/01/reCTE_Lineage.png" alt="Recursive CTE query that selects the lineage of Parents and Children based on a single ID." title="reCTE_Lineage" width="226" height="120" class="size-full wp-image-444" /></a><p class="wp-caption-text">Who is in this Family?</p></div>
<p>That&#8217;s all I&#8217;ve got on CTEs for now. If you want to learn even more, check out <a href="http://www.sqlpass.org/LearningCenter/24Hours2011.aspx" title="Audrey's T-SQL Awesomeness for the 24 Hours of PASS">Audrey Hammond&#8217;s talk on the subject</a>. It&#8217;s number 18 on the list, and it&#8217;ll require a PASS login, but it&#8217;s well worth it. She&#8217;s quite the awesome T-SQL Wizard.</p>
<div class="shr-publisher-437"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/Qnjciyzq5oE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/lets-get-recursive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattvelic.com/lets-get-recursive/</feedburner:origLink></item>
		<item>
		<title>The Twitters</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/ECwqeuV6YxQ/</link>
		<comments>http://mattvelic.com/the-twitters/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 15:06:24 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[#meme15]]></category>
		<category><![CDATA[Jason Strate]]></category>
		<category><![CDATA[meme15]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=435</guid>
		<description><![CDATA[Jason has asked about our Twitter usage, specifically how it has helped us as DBAs or developers, or in our careers as general. Microblog&#8230; Something Else&#8230; Profit! I didn&#8217;t get Twitter at first. I thought that it was a service &#8230; <a href="http://mattvelic.com/the-twitters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://twitter.com/#!/stratesql" title="Follow Jason on Twitter">Jason</a> has asked about our Twitter usage, specifically <a href="http://www.jasonstrate.com/2012/01/january-meme15-assignment/" title="January 2012's meme15 assignment">how it has helped us as DBAs or developers, or in our careers as general</a>.</p>
<h3>Microblog&#8230; Something Else&#8230; Profit!</h3>
<div id="attachment_413" class="wp-caption alignright" style="width: 266px"><a title="Steve F [CC-BY-SA-2.0 (www.creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons" href="http://commons.wikimedia.org/wiki/File%3ATweet_tweet%5E_-_geograph.org.uk_-_1134223.jpg"><img width="256" alt="Tweet tweet^ - geograph.org.uk - 1134223" src="http://upload.wikimedia.org/wikipedia/commons/6/67/Tweet_tweet%5E_-_geograph.org.uk_-_1134223.jpg"/></a><p class="wp-caption-text">A Big, Wooden Twitter!</p></div>
<p>I didn&#8217;t get Twitter at first. I thought that it was a service for <a href="http://theoatmeal.com/comics/twitter_stop" title="The Oatmeal's 10 Things You Need to Stop Tweeting About">self-involved folks to talk incessantly about what they ate</a> at each meal. I sometimes fail in having the best confidence, and I thought, &#8220;Who would even care to learn about what I ate?&#8221;</p>
<p>But I didn&#8217;t get Twitter; I didn&#8217;t understand how people were using it. Sure, there are plenty of people who Tweet about what they ate for lunch, what they bought at the store, what location they just checked in to (and that <a href="http://pleaserobme.com/" title="Check to see if you've shared your location">you are free to rob their houses while they&#8217;re away</a>) &#8211; and even I&#8217;m guilty of such behavior from time to time &#8211; but this isn&#8217;t want Twitter is about. Twitter isn&#8217;t about broadcasting; it&#8217;s about having conversations.</p>
<p>Twitter is a public, global chat room, except it&#8217;s cooler than AOL ever was and you can tune in to just the people you want to hear.</p>
<h3>How I Use Twitter</h3>
<p>When I was unceremoniously handed the role of Accidental DBA, I was alone. I had no one to go to with questions. I didn&#8217;t even have the support of the IT department. What I had was a SQL Server database, the knowledge of how to restart IIS via Command Line (seriously, don&#8217;t ask&#8230;), and a lot of questions around, &#8220;How would I even know if something were going wrong?&#8221;</p>
<p>Like any good geek, I turned to Google for answers. But it wasn&#8217;t until I ran across Brent Ozar&#8217;s blog and <a href="http://www.brentozar.com/twitter/book/" title="Brent's Simple Twitter Book">found his Simple Twitter book</a> that I was sold enough to give Twitter a try.</p>
<p>Twitter saved me. Twitter became my support system at work. Twitter became a way to ask questions, double check assumptions, verify functionality, and blow off steam. Twitter became a way to find new blogs to read, and to share new blogs that I&#8217;ve written. Simply watching the <a href="https://twitter.com/#!/search/%23sqlhelp" title="The real reason to use Twitter">#SQLHelp hashtag</a> through the day opened me to new and often-times esoteric knowledge that I probably wouldn&#8217;t have encountered on my own.</p>
<h3>How Should You Use Twitter?</h3>
<p>Well, you first have to sign up for an account! After that, download a Twitter client to help you manage it. In the past I would&#8217;ve easily recommended TweetDeck, but they&#8217;ve made some changes to their app recently that I don&#8217;t fully approve but at least you can run it in a browser. (Yeah, I know: it&#8217;s free so get over it.) Do some searches for #SQLServer, #SQLHelp, #SQLPeople and #SQLPass to find some interesting and knowledgeable people to follow. And then&#8230;</p>
<p>Jump into the conversation! Offer your opinion, help in answering a question. Don&#8217;t hesitate, don&#8217;t become a lurker. Like I mentioned, Twitter is about conversation, and sure, you&#8217;ll often times jump in right in the middle of things, but that&#8217;s how the SQL Community rolls on Twitter. And it&#8217;s funny how a conversation can thread from clustering to coffee to bacon in a matter of minutes.</p>
<p>Come and join in!</p>
<div class="shr-publisher-435"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/ECwqeuV6YxQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/the-twitters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattvelic.com/the-twitters/</feedburner:origLink></item>
		<item>
		<title>meme Monday January 2012</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/13D0w6ttnGA/</link>
		<comments>http://mattvelic.com/meme-monday-january-2012/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 14:00:09 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[meme Monday]]></category>
		<category><![CDATA[SQLFamily]]></category>
		<category><![CDATA[SQLPeople]]></category>
		<category><![CDATA[Thomas LaRock]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=432</guid>
		<description><![CDATA[Tom LaRock asked what we want to do for our #SQLFamily in the new year: I want to continue bringing the awesomeness of SQLPeople to the community. Beginning today, you can access the newly released video library from SQLInspire NYC &#8230; <a href="http://mattvelic.com/meme-monday-january-2012/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/SQLRockstar" title="Follow Tom on Twitter.">Tom LaRock</a> asked what <a href="http://thomaslarock.com/2012/01/mememonday-for-january/" title="Read Tom's meme Monday announcement.">we want to do for our #SQLFamily</a> in the new year: I want to continue bringing the <a href="http://sqlpeople.net/interview-form/" title="Become a SQLPerson today!">awesomeness of SQLPeople</a> to the community.</p>
<p>Beginning today, you can access the <a href="http://sqlpeople.net/events/sqlinspirenyc2011/sqlinspire-2011-video/" title="Get inspired.">newly released video library from SQLInspire NYC 2011</a>. Seven inspirational talks, fourteen videos filled with wonderful stories and knowledge. Go and consume. Change your life and the SQL community.</p>
<div class="shr-publisher-432"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/13D0w6ttnGA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/meme-monday-january-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattvelic.com/meme-monday-january-2012/</feedburner:origLink></item>
		<item>
		<title>Whose Fault? Who Cares?</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/sSXvabZ6-x0/</link>
		<comments>http://mattvelic.com/whose-fault-who-cares/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 14:30:35 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[Clients]]></category>
		<category><![CDATA[Linchpin]]></category>
		<category><![CDATA[Responsibility]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=430</guid>
		<description><![CDATA[It&#8217;s been said that DBA is actually an abbreviation for &#8220;Default Blame Accepter.&#8221; But when you&#8217;re a contractor instead of the in-house DBA, how does one deal with blame? I can understand not wanting to be wrong. Wrong feels a &#8230; <a href="http://mattvelic.com/whose-fault-who-cares/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been said that <abbr title="Database Administrator">DBA</abbr> is actually an abbreviation for &#8220;Default Blame Accepter.&#8221; But when you&#8217;re a contractor instead of the in-house DBA, how does one deal with blame? I can understand not wanting to be wrong. Wrong feels a lot like failing, and failing feels cruddy. I hate being wrong.</p>
<div id="attachment_413" class="wp-caption alignright" style="width: 250px"><a title='By U.S. Navy photo by Mass Communication Specialist 3rd Class Kevin J. Steinberg [Public domain], via Wikimedia Commons' href='http://commons.wikimedia.org/wiki/File%3AUS_Navy_110626-N-TB177-311_Sailors_aboard_the_guided-missile_destroyer_USS_Truxtun_(DDG_103)_heave_a_line_as_the_ship_pulls_into_port_in_Djibouti.jpg'><img width='240' alt='US Navy 110626-N-TB177-311 Sailors aboard the guided-missile destroyer USS Truxtun (DDG 103) heave a line as the ship pulls into port in Djibouti' src='http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/US_Navy_110626-N-TB177-311_Sailors_aboard_the_guided-missile_destroyer_USS_Truxtun_%28DDG_103%29_heave_a_line_as_the_ship_pulls_into_port_in_Djibouti.jpg/240px-US_Navy_110626-N-TB177-311_Sailors_aboard_the_guided-missile_destroyer_USS_Truxtun_%28DDG_103%29_heave_a_line_as_the_ship_pulls_into_port_in_Djibouti.jpg'/></a><p class="wp-caption-text">When everyone is working towards the same goal, there is no time to assign blame. If even one person does, the whole team fails.</p></div>
<p>That said, I don&#8217;t understand all the smoke, mirrors, and general misdirection in trying to hide wrong in a client situation. Sure, they expect that we know what we&#8217;re doing. (And in the SQL Server sphere, they can sometimes expect a bit too much: &#8220;What? You aren&#8217;t an expert in administration, development, a tuning ninja, a database designer, IS/AS/RS, Warehousing, <em>and</em> an ETL architect?&#8221;) I also understand that we like to appear as superheroes to our clients, especially since that helps to keep the money flowing in.</p>
<p>But I think there comes a point in a project when the energy expended in dodging responsibility becomes greater than the energy required to fix the problem. And the whole situation rots into a stinking mess when multiple contractors are involved.</p>
<p>But you know what? When <strong>&#8220;Whose fault?&#8221;</strong> becomes more important than <strong>&#8220;How can we help?&#8221;</strong> <em>everyone has failed</em>. We may not like the other contractors or vendors that we have to work with, but positive outcomes for the client should never be put into jeopardy due to internal positioning and bickering.</p>
<p>If you want to keep your clients, follow these three simple steps: First, step up. Second, take responsibility. <a href="http://sethgodin.typepad.com/seths_blog/2011/12/i-am-here.html" title="Read I am Here by Seth Godin">Third, keep your promises and deliver.</a> You will become that superhero the client falls in love with and continues to utilize.</p>
<div class="shr-publisher-430"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/sSXvabZ6-x0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/whose-fault-who-cares/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://mattvelic.com/whose-fault-who-cares/</feedburner:origLink></item>
		<item>
		<title>Blog Cause I Wanna</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/PTLWuwm4ib0/</link>
		<comments>http://mattvelic.com/blog-cause-i-wanna/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 18:26:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[#meme15]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Jason Strate]]></category>
		<category><![CDATA[meme15]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=424</guid>
		<description><![CDATA[Jason Strate is launching a new blogging series entitled #meme15. It attempts to give some blogging fodder for the 15th of each month. This first topic is about Meta-Blogging. (Blogging about blogging.) Jason&#8217;s asked why did we first begin to &#8230; <a href="http://mattvelic.com/blog-cause-i-wanna/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="https://twitter.com/#!/stratesql" title="Follow Jason on Twitter">Jason Strate</a> is launching a <a href="http://www.jasonstrate.com/2011/12/the-meme15-on-social-networking/" title="Read the meme15 announcement on Jason's blog">new blogging series entitled #meme15</a>. It attempts to give some blogging fodder for the 15th of each month. This first topic is about Meta-Blogging. (Blogging about blogging.) Jason&#8217;s asked why did we first begin to blog, and why do we keep blogging?</p>
<h3>In the Beginning</h3>
<p>Darkness, light, creation, and all that jazz. I&#8217;ve blogged before I came to the SQL Server community, and before I identified as a technologist at all. My blogging was a mix between the personal and the DC art world. Those sites are gone now, save for in the <a href="http://www.archive.org/web/web.php" title="Have fun searching the Way Back Machine">Way Back Machine</a>. (Asides: I tried to grab a screenshot, but they didn’t have any nice looking ones.)</p>
<h3>And Forever Continuing</h3>
<div id="attachment_413" class="wp-caption alignright" style="width: 250px"><a title='By Philipp Keel [CC-BY-SA-2.0 (www.creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons' href='http://commons.wikimedia.org/wiki/File%3ASimple_Diary_Covers_Fan300x300.jpg'><img width='240' alt='Simple Diary Covers Fan300x300' src='http://upload.wikimedia.org/wikipedia/commons/d/d9/Simple_Diary_Covers_Fan300x300.jpg'/></a><p class="wp-caption-text">Analog Blogs</p></div>
<p>I blog primarily because I like to share things. Sometimes it&#8217;s personal information about what&#8217;s happening in my life. Now I tend to focus on sharing knowledge about SQL Server and design topics. But I&#8217;m always sharing.</p>
<p>I blog because <a href="http://mattvelic.com/write-better-in-30-days/" title="Read more about National Novel Writing Month">I enjoy writing</a>. While I do have periods of writer&#8217;s block, I don&#8217;t have trouble with the blank page. I&#8217;ve learned to turn off my inner editor. I&#8217;ve learned to have fun in communicating, because if you don&#8217;t get enjoyment out of the activity, why the hell do it? (Not always true, of course, but especially true for blogging to a community that has many fantastic resources already.)</p>
<p>I blog because I think it&#8217;s helped to open up opportunities to me. It&#8217;s drawn me into becoming a presenter for the community. I&#8217;ve been approached about writing articles. It hasn&#8217;t helped to land me that Dream Gig (yet), but I don&#8217;t feel it&#8217;s hurt me either. I don&#8217;t think Andy and Brian would have asked me to <a href="http://sqlpeople.net/admin/2011/08/31/matt-velic-joins-sqlpeople/" title="Read about my joining SQLPeople">join SQLPeople</a> if I hadn&#8217;t been an active writer.</p>
<h3>Lesson: It Really is About You</h3>
<p>Like many others, I don&#8217;t blog for the page views or the visitor stats. I don&#8217;t blog because I make any money. I&#8217;ll admit that sometimes the analytics psych me out, but in comparison to my pre-SQL Server blogging, it&#8217;s the difference between night and day.</p>
<p>One of the main reasons I continue to blog is I feel that I&#8217;ve found the right audience. Despite all the great resources available, this community hungers for more. We all share the same voracious appetite for information. And there&#8217;s enough depth to the technology that there&#8217;s plenty of room for all kinds of content ranging from novice to expert level topics.</p>
<p>For all those writers out there, and for those that would like to begin writing, here is an important lesson: work on style and content, yes, but also find the right audience for your work. <em>It’s critical that you do.</em> The right audience will love the hard work you&#8217;re doing for them, and they&#8217;ll return the favor by spreading your work further. More, those people make all that work a pleasure.</p>
<div class="shr-publisher-424"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/PTLWuwm4ib0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/blog-cause-i-wanna/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://mattvelic.com/blog-cause-i-wanna/</feedburner:origLink></item>
		<item>
		<title>T-SQL Tuesday 25: Easy Integrity</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/_xzDz91IDuA/</link>
		<comments>http://mattvelic.com/tsql-tuesday-25/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 12:21:21 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[T-SQL Tuesday]]></category>
		<category><![CDATA[Allen White]]></category>
		<category><![CDATA[Database Design]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=422</guid>
		<description><![CDATA[This month&#8217;s T-SQL Tuesday is hosted by Allen White. Allen has asked about T-SQL tips that make our work easier. I would like to share one around development. Everyone knows that both Primary and Foreign Keys must share a few &#8230; <a href="http://mattvelic.com/tsql-tuesday-25/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_56" class="wp-caption alignright" style="width: 160px"><a href="http://sqlblog.com/blogs/allen_white/archive/2011/12/05/t-sql-tuesday-025-invitation-to-share-your-tricks.aspx"><img src="http://mattvelic.com/wp-content/uploads/2010/07/TSQL2sDay150x150.jpg" alt="Logo for T-SQL Tuesday" title="TSQL2sDay150x150" width="150" height="150" class="size-full wp-image-56" /></a><p class="wp-caption-text">T-SQL Tuesday</p></div>
<p>This month&#8217;s T-SQL Tuesday is hosted by <a href="http://twitter.com/SQLRunr" title="Follow Allen on Twitter">Allen White</a>. Allen has asked about <a href="http://sqlblog.com/blogs/allen_white/archive/2011/12/05/t-sql-tuesday-025-invitation-to-share-your-tricks.aspx" title="Allen's T-SQL Tuesday Invitation">T-SQL tips that make our work easier</a>. I would like to share one around development.</p>
<p>Everyone knows that both <a href="http://msdn.microsoft.com/en-us/library/ms191236.aspx" title="MSDN's article on Primary Keys">Primary</a> and <a href="http://msdn.microsoft.com/en-us/library/ms175464.aspx" title="MSDN's article on Foreign Keys">Foreign Keys</a> must share a few common attributes, such as sharing the same data type. But they do not need to share the same name, and this is something that I believe can hinder query development. Here&#8217;s an example:</p>
<pre type="syntaxhighlighter" class="brush: sql">
CREATE TABLE dbo.Donors(
	Donor_ID	INT			IDENTITY(1,1)	PRIMARY KEY,
	First_Name	NVARCHAR(20)	NOT NULL,
	Last_Name	NVARCHAR(40)	NOT NULL
);

CREATE TABLE dbo.Gifts(
	Gift_Key	INT			IDENTITY(1,1)	PRIMARY KEY,
	Person_ID	INT			NOT NULL,
	Amount		MONEY		NOT NULL,
	Tender		VARCHAR(13)	NOT NULL,
	Gift_Date	DATE		NOT NULL,
	Campaign	VARCHAR(14)	NOT NULL
);

ALTER TABLE dbo.Gifts
ADD CONSTRAINT FK_Gift_Donor FOREIGN KEY (Person_ID)
	REFERENCES dbo.Donors (Donor_ID);
</pre>
<p>In this example, a foreign key relationship exists between Donor_ID and Person_ID. And in a simple, two table example, this isn&#8217;t likely to create any issues. But I&#8217;m certain that you don&#8217;t have to stretch your imagination to see how this may become a development issue when you are working against a whole database. And the problem is exacerbated once you begin to work on dozens of databases all at once.</p>
<p>What problem am I referencing? The problem of memory.</p>
<h3>The Problem of Memory</h3>
<p>Here is the previous code rewritten following my tip. You&#8217;ll notice that both columns referenced in the Foreign Key Constraint have the same name.</p>
<pre type="syntaxhighlighter" class="brush: sql">
CREATE TABLE dbo.Donors(
	Donor_ID	INT			IDENTITY(1,1)	PRIMARY KEY,
	First_Name	NVARCHAR(20)	NOT NULL,
	Last_Name	NVARCHAR(40)	NOT NULL
);

CREATE TABLE dbo.Gifts(
	Gift_Key	INT			IDENTITY(1,1)	PRIMARY KEY,
	Donor_ID	INT			NOT NULL,
	Amount		MONEY		NOT NULL,
	Tender		VARCHAR(13)	NOT NULL,
	Gift_Date	DATE		NOT NULL,
	Campaign	VARCHAR(14)	NOT NULL
);

ALTER TABLE dbo.Gifts
ADD CONSTRAINT FK_Gift_Donor FOREIGN KEY (Donor_ID)
	REFERENCES dbo.Donors (Donor_ID);
</pre>
<p>And here&#8217;s a query written against both examples. They&#8217;ll each return the same results with the same performance&#8230; but which do you think was less taxing mentally to write?</p>
<pre type="syntaxhighlighter" class="brush: sql">
SELECT d.Donor_ID, d.First_Name, g.Gift_Date, g.Gift_Amount
FROM dbo.Donors AS d
LEFT OUTER JOIN dbo.Gifts AS g
	ON d.Donor_ID = g.Person_ID
WHERE g.Gift_Amount >= 10

--versus

SELECT d.Donor_ID, d.First_Name, g.Gift_Date, g.Gift_Amount
FROM dbo.Donors AS d
LEFT OUTER JOIN dbo.Gifts AS g
	ON d.Donor_ID = g.Donor_ID
WHERE g.Gift_Amount >= 10
</pre>
<p>Personally, it&#8217;s the second. I don&#8217;t have to take a split second to think &#8220;Did I join those tables on the right columns?&#8221; I don&#8217;t have to take thirty seconds to look up that information if I&#8217;ve guessed wrong. Naming your constraints the same takes the guess work out of query writing. It may not be a game-changer, but this has helped me in a number of occasions, and I hope it helps you too.</p>
<div class="shr-publisher-422"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/_xzDz91IDuA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/tsql-tuesday-25/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattvelic.com/tsql-tuesday-25/</feedburner:origLink></item>
		<item>
		<title>Never Not Busy</title>
		<link>http://feedproxy.google.com/~r/MattVelic/~3/gTKsXz6LtKQ/</link>
		<comments>http://mattvelic.com/never-not-busy/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 14:30:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[GTD]]></category>
		<category><![CDATA[Seth Godin]]></category>
		<category><![CDATA[Thomas LaRock]]></category>

		<guid isPermaLink="false">http://mattvelic.com/?p=419</guid>
		<description><![CDATA[I&#8217;ve come to a realization this week: &#8220;I&#8217;m busy&#8221; has become my new go-to excuse for not getting work done. And it&#8217;s awful. The most awful part about that particular excuse is that it&#8217;s always true. There&#8217;s always a blog &#8230; <a href="http://mattvelic.com/never-not-busy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come to a realization this week: &#8220;I&#8217;m busy&#8221; has become my new go-to excuse for not getting work done. And it&#8217;s awful. The most awful part about that particular excuse is that it&#8217;s always true. There&#8217;s always a blog post to be written; an email to respond to; family to spend time with; your personal brand to manage online.</p>
<p>We&#8217;ve made it impossible to be unbusy.</p>
<p>When you subscribe [like I do] to <a href="http://sethgodin.typepad.com/seths_blog/2010/01/quieting-the-lizard-brain.html" title="Read about the Lizard Brain on Seth's blog">the Godin-ian mindset of fighting your inner Resistance</a> in order to do important work, Busy becomes the easiest way to placate yourself into thinking that you&#8217;ll eventually get all that stuff done. You aren&#8217;t giving in. You aren&#8217;t giving up. You are simply Busy.</p>
<h3>Done with Busy</h3>
<p>A few days ago, I shared a link (which was shared with me by <a href="http://twitter.com/SQLRockstar" title="Follow Tom on Twitter">Tom LaRock</a>) about <a href="http://www.brepettis.com/blog/2009/3/3/the-cult-of-done-manifesto.html" title="Check out the manifesto on Bre Pettis' blog">The Cult of Done Manifesto</a>. While many of its precepts rely and build upon each other, the very last rule, lucky number thirteen, wraps up the whole philosophy and is the most important.</p>
<blockquote><p>13. Done is the engine of more.</p></blockquote>
<p>I&#8217;d like to think that Done is good habit that can be built. That it can help fight The Resistance, and banish Busy. I hope that by recognizing Busy as a prime excuse, I can stop using it; I can remain focused on producing great work for my family, friends, and the SQL Server community. If Busy is one of your excuses as well, <a href="http://twitter.com/mvelic" title="Contact me on Twitter">we can support each other</a> in getting the work done for the betterment of all.</p>
<p>So who&#8217;s busy?</p>
<h3>Standard Disclaimers Apply</h3>
<p>Of course, working yourself up into a frothy mix of anxiety from all the work you <em>aren&#8217;t</em> getting done isn&#8217;t useful either. The standard life-work balancing act applies in all things. It&#8217;s making choices and prioritizing what&#8217;s important. Your family needs you today and every day. So do your friends and co-workers. But maybe you can TiVo that episode of <abbr title="Naval Criminal Investigative Service">N.C.I.S.</abbr> and build something that is life-changing.</p>
<div class="shr-publisher-419"></div><img src="http://feeds.feedburner.com/~r/MattVelic/~4/gTKsXz6LtKQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattvelic.com/never-not-busy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattvelic.com/never-not-busy/</feedburner:origLink></item>
	</channel>
</rss>

