<?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>A Wandering Mind</title>
	
	<link>http://awanderingmind.com</link>
	<description>How I deal with all the clutter in my head... and other geeky goodness</description>
	<lastBuildDate>Sun, 22 Jan 2012 19:58:26 +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/awanderingmind/Fzqz" /><feedburner:info uri="awanderingmind/fzqz" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The Importance of Making Junk</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/EorlwiG3F9s/</link>
		<comments>http://awanderingmind.com/2012/01/22/the-importance-of-making-junk/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 19:58:13 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[perspective]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=682</guid>
		<description><![CDATA[I was just sitting here looking over some old code projects of mine, and thinking &#8220;Man this stuff is junk. How&#8217;d I write this?! And why&#8217;d I waste my time on it?&#8221; These included a Java library for parsing tweets for data mining (boy that was going to be a great open source project), my [...]]]></description>
			<content:encoded><![CDATA[<p>I was just sitting here looking over some old code projects of mine, and thinking &#8220;Man this stuff is junk. How&#8217;d I write this?! And why&#8217;d I waste my time on it?&#8221; These included a Java library for parsing tweets for data mining (boy that was going to be a great open source project), my first .NET application that was for work and used Microsoft Access as a back-end, and various other half-started works that never really took hold. At first this was rather discouraging, since it reminded me of my genetic pre-disposition to not following through on my projects (a topic for another day for sure).</p>
<p>Then it hit me: it&#8217;s only by writing all this crap (and believe me, most of it really is steaming piles of crap), trying out different routes and ideas, and ultimately letting them fall off that I&#8217;ve been able to improve my skills as much as I have. Picture the proverbial writer sitting at the typewriter with a pile of crumpled papers next to them, head in hands. But then, one day, something clicks, and out comes a masterpiece.</p>
<p>It&#8217;s not important that all we produce is wonderful, glittery, and perfect. No, what&#8217;s really crucial is that we keep going and pushing ourselves, especially when it seems like all we churn out is junk. That junk is <em>gold</em>, because it&#8217;s what teaches us to do better. As long as we keep learning from our mistakes and bad ideas, then we grow as professionals and human beings. And sooner or later, you might just produce that golden egg.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2012/01/22/the-importance-of-making-junk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2012/01/22/the-importance-of-making-junk/</feedburner:origLink></item>
		<item>
		<title>One (Very Important) Goal For 2012 – AUTOMATE EVERYTHING</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/dxlVUglQDvE/</link>
		<comments>http://awanderingmind.com/2012/01/02/one-very-important-goal-for-2012-automate-everything/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 21:54:31 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Life As A DBA]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=674</guid>
		<description><![CDATA[Yep, you heard me right. I am going to automate everything I do. Or, at least, try to. I&#8217;m not going to talk in detail about why I&#8217;m doing this, other than to say: I have better things to do with my time than perform mundane, repeatable tasks. I recently re-read John Sansom&#8217;s excellent blog [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, you heard me right. I am going to <strong>automate everything I do</strong>. Or, at least, try to.</p>
<p>I&#8217;m not going to talk in detail about why I&#8217;m doing this, other than to say:</p>
<ol>
<li>I have better things to do with my time than perform mundane, repeatable tasks.</li>
<li>I recently re-read John Sansom&#8217;s <a href="http://www.johnsansom.com/the-best-database-administrators-automate-everything/">excellent blog post</a> on the subject, and, as is usually the case with John&#8217;s work, found it rather inspiring. Bravo John!</li>
</ol>
<p>Instead, I&#8217;m going to talk a little about two kinds of &#8220;automation&#8221;, and why I generally pick one that might not, at first glance, be the right choice.</p>
<h1>Full versus Partial Automation</h1>
<p>I will define something that is <strong>fully automated</strong> as a task or operation which requires absolutely zero manual effort on my part. That is, I don&#8217;t have to push a button, flip a switch, type a command, or even know that it is happening, unless something goes wrong. An example of something that is already fully automated in my world is the weekly and daily database maintenance that I have installed, using Ola Hallengren&#8217;s <a href="http://ola.hallengren.com/" target="_blank">excellent (and freely available) scripts</a>. These run every night and ensure that my databases are backed up, corruption free, and optimized. Unless something goes *bump* and the jobs fail, I don&#8217;t get so much as an e-mail upon completion.</p>
<p>By contrast, a process that is <strong>partially automated</strong> requires some manual effort, but is still optimized such as to require as little work on my part as possible. I may need to open a script, enter a few parameters, or run a Powershell command, but outside of that, all the logic and processing is done behind the scenes, with perhaps a pretty little progress bar showing that work is, well, progressing. An example of this might be setting up of a server side SQL trace; I have a series of scripts ready that, given a database name and a path at which to place the trace files, will setup a standardized trace, grant rights on some signed stored procedures to allow non-DBAs to read the trace data, and even generate a README file to be sent to the requesting team with a series of instructions.</p>
<p>In an ideal world, I suppose that all of the mundane daily work I have to take care of would be in the former (<strong>fully automated</strong>) category. But in reality, I find that there&#8217;s a bit of a diminishing return on putting more and more effort into fully automating tasks. Consider this scenario / requirement: the request and creation of new databases.</p>
<p>At a basic level, the process we follow is something like this:</p>
<ol>
<li>A developer requests a new database via our in-house ticketing system.</li>
<li>We (my team) ensure that the request at least contains the following details:</li>
<ol>
<li>The name of the database.</li>
<li>The server on which to create it (or at least a version of SQL Server).</li>
<li>The initial size of the database.</li>
<li>The domain users or group that requires access to the database.</li>
</ol>
<li>Assuming we&#8217;ve got all the information required, we will go out to the database server where the databases will be placed, and determine a suitable location to place the data files. This is usually determined by simple the simple rule of &#8220;whichever volume has the most space&#8221;, with a few exceptions. If there is not enough space on the server, we&#8217;ll inform the requestor that there will be a delay, and start the process of ordering more storage.</li>
<li>Once we know where the data and log files will be placed, we will create the database, take a full backup (to initialize the differential backup chain), and grant the access requested.</li>
</ol>
<p>Now, I could certainly envision writing some kind of application that would allow developers to submit requests for new databases and process everything straight through based on the rules outlines above, similar to what I see on my web host&#8217;s control panel for MySQL databases. But, at the same time, constructing such as system would take a lot of time and effort. Contrast that with a partial automation solution, such as:</p>
<ul>
<li>Provide an InfoPath form for the requests, forcing people to enter the necessary details in before submitting the request, thereby eliminating back-and-forth chatter.</li>
<li>Use a Powershell script that, when given a server name, database, and log file size, will connect via WMI and determine a list of suitable locations for placing the database files, then prompt the user to select one. When selections are made, the database is created and a full backup taken. This eliminates logging into the computer (to look at drives) and stepping through a bunch of GUI screens to create the database.</li>
<li>Have a second Powershell script that can accept a text file containing domain groups / users and role names, which will then grant the access required on a specified database. The file could be generated from the InfoPath form. Again, this eliminates some GUI clicks, and minimizes the chance of fat-fingering group / user names.</li>
</ul>
<p>While this will not prevent someone from having to manually process the request, it will significantly cut down on the pain to do so, without a great deal of effort / complexity. Especially considering that these requests are fairly infrequent (perhaps one to three a month), I see no reason to spend additional time on providing a fully automated solution, when the partial one provides almost as much value.</p>
<p>Over the course of the year, I&#8217;ll be blogging about the various processes / means I use to accomplish this goal.</p>
<p>How do you automate your processes, and how do you determine a &#8220;break-even&#8221; point, if you will?</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2012/01/02/one-very-important-goal-for-2012-automate-everything/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2012/01/02/one-very-important-goal-for-2012-automate-everything/</feedburner:origLink></item>
		<item>
		<title>Are your processes generic?</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/4xVEcWkNg54/</link>
		<comments>http://awanderingmind.com/2011/12/11/are-your-processes-generic/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 01:40:28 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[The Lone DBA]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=667</guid>
		<description><![CDATA[This post is the sixth in an ongoing series about how to survive as the only DBA in your organization. Since October of last year, I’ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It’s a great team of seasoned professionals, but not a single other DBA. As a result, [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the sixth in an <a href="http://awanderingmind.com/category/sql/the-lone-dba/">ongoing series</a> about how to survive as the only DBA in your organization. Since October of last year, I’ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It’s a great team of seasoned professionals, but not a single other DBA. As a result, I’ve had to think very carefully about how I go about my daily work, so as to give our customers consistently good service, while still allowing those without a lot of SQL Server related knowledge to pick up my work when I’m not available.</p>
<h2>Why is being generic a good thing?</h2>
<p>When I think of the word &#8220;generic&#8221;, I usually picture those off-brand foods at most grocery stores, with their simplistic labels and lackluster colors. But in the case of processes, being &#8220;generic&#8221; really means &#8220;standardized, yet flexible&#8221;. This is a good thing, because it means your processes can answer many different (but ultimately) related needs.</p>
<p>Let&#8217;s take an example: a development team needs to trace activity in their database. We&#8217;re going to assume that just granting this group rights to run the trace is not an option, since, let&#8217;s say, they&#8217;ve taken the server down with a poorly done client side trace in the past (don&#8217;t laugh, it happened to me). In any case, let&#8217;s look at three options to answer this request:</p>
<h3>Have the developers sit with you while you run a Profiler trace</h3>
<p>I don&#8217;t like this for several reasons, not the least of which is that it is going to take a good chunk of my time. Because of course, the developer will probably have no idea what they are looking for, and may not be able to product the condition they are trying to capture on demand. It also still uses Profiler, which, as far as I&#8217;m concerned, should be banned.</p>
<h3>Script out a one-time trace and have it run on the server</h3>
<p>This is better, because it takes a lot less of my time to simply setup a server-side trace and let it run. I can then let the developer&#8217;s read in the trace files via something like a signed stored procedure (a topic for another day perhaps). But there&#8217;s still the one-off aspect: who&#8217;s to say that the next time the developers need this I&#8217;ll be around, have saved the trace definition, etc?</p>
<h3>Write a templatized script that accepts a database name and a path for trace files, and use it going forward</h3>
<p>This, to me at least, is the best option. After a slightly longer initial setup (one-time to write and document the script, plus test it), setting up subsequent traces will take very little time. In addition, the use of a template will mean a consistent experience / process for my customers, even when I&#8217;m not around. Even when I am around, it will also make it easier for DBA Junior to handle the request, leaving me to look at more interesting things. And by making the script flexible enough to handle different servers / databases, it becomes much more useful. </p>
<p>I go so far as to have a &#8220;no one-off&#8221; policy at work. That is, if I do something, I script it, put some parameters in, and save it off to source control. Then I publish it in our procedures manual, so that if a similar request comes in the team can handle it right away. It leads to a lot of scripts that are not highly used, but it also means less work in the long term, and a great bag of tricks in the process.</p>
<h2>But, can something be <em>too</em> generic?</h2>
<p>Sure it can. I&#8217;ve fallen into the trap many times of trying to have one process fit way too many needs, only to end up with a monstrous, un-followable mess. If you&#8217;ve got a ton of &#8220;if this is true, do this, otherwise do this&#8221; type of logic in your process, you might want to consider if you&#8217;re really answering related needs. This is kind of like the process equivalent of that awful stored procedure we&#8217;ve all seen; you know, the one that has twenty plus input parameters, and has every one in the WHERE clause as <code>WHERE ((some_field = @some_parameter) OR (@some_parameter = NULL))</code>. It looks good, but in the end the execution is piss poor.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/12/11/are-your-processes-generic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/12/11/are-your-processes-generic/</feedburner:origLink></item>
		<item>
		<title>The Lone DBA – Why Documentation Is Good</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/VlNKRAUpVbg/</link>
		<comments>http://awanderingmind.com/2011/10/19/the-lone-dba-why-documentation-is-good/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 12:00:53 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[The Lone DBA]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=661</guid>
		<description><![CDATA[This post is the fifth in an ongoing series about how to survive as the only DBA in your organization. Since October of last year, I&#8217;ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It&#8217;s a great team of seasoned professionals, but not a single other DBA. As a result, [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the fifth in an <a href="http://awanderingmind.com/category/sql/the-lone-dba/">ongoing series</a> about how to survive as the only DBA in your organization. Since October of last year, I&#8217;ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It&#8217;s a great team of seasoned professionals, but not a single other DBA. As a result, I&#8217;ve had to think very carefully about how I go about my daily work, so as to give our customers consistently good service, while still allowing those without a lot of SQL Server related knowledge to pick up my work when I&#8217;m not available.</p>
<h3>Why I Hate Writing Documentation</h3>
<p>The answers to this question are pretty straightforward, but as we&#8217;ll see, there&#8217;s counter-arguments in most cases.</p>
<h4>It Makes The Work Take Longer</h4>
<p>It&#8217;s true that documenting a process means taking longer to actually complete the work. Consider the added time to take screenshots, write down steps, and (of course) test to ensure completeness, and it could well double the amount of time required.</p>
<p>On the other hand, this increase in time should be pretty much a one-time occurence, with occasional tune-ups of the documentation required as procedures change and evolve. So really, it&#8217;s not that much extra work.</p>
<h4>The Logic Is Too Complex To Document</h4>
<p>STOP!</p>
<p>On this one I have to call my own bullshit. <strong>There is no such thing as a process that is too complex to document.</strong> It may take pages upon pages of screenshots and steps, and turn into a forty page monstrosity, but it&#8217;s still quantifiable.</p>
<p>So let&#8217;s be honest here: what we&#8217;re really saying is that <strong>we&#8217;re too lazy to take the time to document our process, because it would take a long time</strong>. Everyone agreed? Let&#8217;s just suck it up then and move on, because <strong>laziness is never an excuse for bad practice</strong>.</p>
<h4>It&#8217;s Really Boring</h4>
<p>Well that one is easy to answer. You see, all you have to do is&#8230; um&#8230; well&#8230;</p>
<p><strong>*thinks*</strong></p>
<p>Okay, you&#8217;ve got me. I can&#8217;t really think of a way to make writing documentation fun. Oh well, there are some things in our jobs that just aren&#8217;t going to be fun. All we can do is minimize them, perhaps by <a href="http://awanderingmind.com/2011/10/17/the-lone-dba-why-automating-processes-is-good/">automating things as much as possible</a>?</p>
<h3>Why I Love Writing Documentation</h3>
<h4>It Lets Me Outsource</h4>
<p>If I have a process thoroughly documented, it makes it easier to hand off to a junior DBA or other staff. This then frees me up to do more interesting or important things. Why spend time doing things that someone else could do just as well, when I could be doing things that provide real value to my customers?</p>
<h4>It Ensures Consistent Service</h4>
<p>To me this is the big one. If my documentation is complete, I can leave for vacation knowing that my customers will be well taken care of while I&#8217;m gone. Good customer service means consistency: they provide the same input (a request to restore a database), and receive the same output (the database is restored and permissions re-granted). Without documentation there&#8217;s no guarantee that someone else on my team would handle the request the same way I would; with it, the customer won&#8217;t even notice a difference.</p>
<p>So now I&#8217;ll pose a question to the community: How do you motivate yourself to write documentation? How do you ensure it is kept up to date?</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/10/19/the-lone-dba-why-documentation-is-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/10/19/the-lone-dba-why-documentation-is-good/</feedburner:origLink></item>
		<item>
		<title>The Lone DBA – Why Automating Processes Is Good</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/nqJEedDugWw/</link>
		<comments>http://awanderingmind.com/2011/10/17/the-lone-dba-why-automating-processes-is-good/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 19:35:36 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Life As A DBA]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[The Lone DBA]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=650</guid>
		<description><![CDATA[This post is the fourth in an ongoing series about how to survive as the only DBA in your organization. Since October of last year, I’ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It’s a great team of seasoned professionals, but not a single other DBA. As [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the fourth in an <a href="http://awanderingmind.com/category/sql/the-lone-dba/">ongoing series</a> about how to survive as the only DBA in your organization. Since October of last year, I’ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It’s a great team of seasoned professionals, but not a single other DBA. As a result, I’ve had to think very carefully about how I go about my daily work, so as to give our customers consistently good service, while still allowing those without a lot of SQL Server related knowledge to pick up my work when I’m not available.</p>
<h3>Automation Is A (Lone) DBA&#8217;s Best Friend</h3>
<p>I subscribe wholly to the sentiment expressed in <a href="http://www.johnsansom.com/the-best-database-administrators-automate-everything/">John Sansom&#8217;s excellent post</a>, titled &#8220;The Best Database Administrators Automate Everything&#8221;. Time is something we cannot make more of for ourselves, and as such is highly precious. If you are spending time doing repetitive work that could be either partially or fully automated, that is time wasted.</p>
<p>But there&#8217;s another benefit as well to automating processes: it makes them easier to hand-off. Let&#8217;s consider the example of restoring a copy of a production database to a test server. The typical steps I would complete would be:</p>
<ol>
<li>Determine the location that the backup file was placed at by the production DBA group (I do not have access to production backups, so they must copy them down to my server).</li>
<li>Determine where the database files should be placed on the server using this logic:</li>
<ol>
<li>If the database already exists on the server, the files should be placed at the same location as they currently reside.</li>
<li>If the database does not exist, then the files should be placed at the default data and log location as specified in the server configuration.</li>
</ol>
<li>If the database exists, set the database to single user mode using the &#8220;WITH ROLLBACK IMMEDIATE&#8221; option to effectively kill any open connections to the database.</li>
<li>Issue the restore command, using native commands or the Litespeed equivalent if the database came from a server using Litespeed.</li>
<li>Execute the databases specific post restore script from the source code repository. These scripts reset permissions for developers, synchronize users, etc.</li>
</ol>
<p>While none of these steps are particularly hard, documenting them and teaching them to others would not be a small amount of work. Consider that step two involves querying system tables (or stepping through some screens in SSMS), and steps three and four require knowledge of T-SQL commands for restoring databases.</p>
<p>Instead, I chose to write a Powershell script which handles as much of the logic as possible. All it requires is a server name and the name of a backup file, and it handles the rest (except step five, but I&#8217;m working on that). This way, instead of teaching all that logic, all I need to do is show someone how to find the backup file (further simplified by standardizing paths across all the servers) and run the script.</p>
<p>I don&#8217;t know about you, but I&#8217;d much rather write code to do a job than write a document about how to do the job manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/10/17/the-lone-dba-why-automating-processes-is-good/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/10/17/the-lone-dba-why-automating-processes-is-good/</feedburner:origLink></item>
		<item>
		<title>The Lone DBA – What Makes A Process Simple?</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/n1Rgs_wv2gA/</link>
		<comments>http://awanderingmind.com/2011/10/17/the-lone-dba-what-makes-a-process-simple/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 12:00:23 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Life As A DBA]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[The Lone DBA]]></category>
		<category><![CDATA[Simplicity]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=646</guid>
		<description><![CDATA[This post is the third in an ongoing series about how to survive as the only DBA in your organization. Since October of last year, I’ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It’s a great team of seasoned professionals, but not a single other DBA. As [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the third in an <a href="http://awanderingmind.com/category/sql/the-lone-dba/">ongoing series</a> about how to survive as the only DBA in your organization. Since October of last year, I’ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It’s a great team of seasoned professionals, but not a single other DBA. As a result, I’ve had to think very carefully about how I go about my daily work, so as to give our customers consistently good service, while still allowing those without a lot of SQL Server related knowledge to pick up my work when I’m not available.</p>
<h3>What Makes A Process Simple?</h3>
<blockquote><p>sim·ple   [sim-puhl] adjective</p>
<ol>
<li>easy to understand, deal with, use, etc.: a simple matter; simple tools.</li>
<li>not elaborate or artificial; plain: a simple style</li>
<li>not ornate or luxurious; unadorned: a simple gown</li>
<li>unaffected; unassuming; modest: a simple manner</li>
<li>not complicated: a simple design</li>
</ol>
</blockquote>
<p>When I design a process for my team to follow, I always do my best to follow the definition above, especially the first and last lines. Processes should be easy to follow and only as complex as they need to be, no more. Programmers can sometimes get carried away with complexity, because a) it&#8217;s fun, b) it lets us stretch our muscles a little. That&#8217;s all fine and good in your lab, but when you&#8217;re trying to design something to be used in the real world by actual people (other than yourself), complexity can be a huge problem.</p>
<p>Take this example: your team needs a way to locate information about a particular server, including what it&#8217;s used for, make and model, etc. Here&#8217;s two choices for how you fulfill this requirement.</p>
<h4>Option A &#8211; Command line / SQL scripts and a SQL Database</h4>
<p>Sounds easy enough, right? And a relational database seems like the perfect place to store this kind of structured information.</p>
<p>Well, that&#8217;s great, for someone who is comfortable writing T-SQL code to interrogate a database. And who understands the structure of the database. And, oh by the way, can even find where the database is.</p>
<p>I&#8217;m guilty as charged on this one. When I started on my team there was no repository for server inventory, so I made one. I&#8217;d call it a pretty well designed database, normalization and structure wise, but there&#8217;s one glaring flaw: no interface. Every operation, such as adding a server, removing one, looking up information about one, etc, is done via T-SQL scripts (hand-written mostly). Fine for me, but my teammates are going to quickly get lost and just call me when they need information.</p>
<p>Let&#8217;s assume I&#8217;ve even saved scripts in our code library for common operations, such as looking up a server&#8217;s information by its name (not always a valid assumption, certainly). Even with that shortcut, so the team doesn&#8217;t have to write JOIN statements, consider the list of steps required to look up a server:</p>
<ol>
<li>locate the correct script in the repository</li>
<li>Open the script in SSMS (do they have that installed?)</li>
<li>Connect to the server where the management database resides (do they know where that is?)</li>
<li>Look through the script and find the &#8220;find/replace&#8221; tags (I would at least use SSMS template parameters, though it&#8217;s debatable if that is easier)</li>
<li>Execute the script and interpret the resulting text output</li>
</ol>
<p>Hmm&#8230; five steps and several questions. Not very simple.</p>
<h4>Option B &#8211; A Small Web Application With A SQL Back End</h4>
<p>With this choice, we still get the benefits of storing the data in relational format, but with a cleaner interface (even my crappy UI design skills can manage this one). Most competent admins can understand a web interface with fields and buttons, so they should have little problem using it once trained (and of course, its use would be documented).</p>
<p>Consider the steps required to perform the same operation here:</p>
<ol>
<li>Open a web browser and browse to the web site (do they know where it is?)</li>
<li>Select the &#8220;Find Server By Name&#8221; option presented on the home page.</li>
<li>Enter the server name and click the &#8220;Find&#8221; button.</li>
</ol>
<p>We&#8217;re down to three steps and only one question (do they know what the site address / URL is). Now we&#8217;re getting into the realm of simple.</p>
<p>One could certainly argue that there&#8217;s an even easier solution, along the lines of a folder on a searchable network drive with a set of Word documents, one per server, in standard format. I wouldn&#8217;t discount that argument, but I just really had folders full of Word documents, especially when you have to go through all of them one at a time to change some common field.</p>
<p>You could also argue that the process of writing a web application (and supporting it) would outweigh the simplicity gained by having the information presented in that manner. After all, can anyone else on your team understand C# code? What happens when it breaks and you&#8217;re on vacation? That may be true, but I honestly believe that if you write your code properly (and, drumroll please, <em>simply</em>) then the application should be pretty much self-sufficient. Good code hums along and doesn&#8217;t require babysitting.</p>
<p>So the next time you&#8217;re designing a process for your team, remember to keep things as simple as you can. Your teammates will thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/10/17/the-lone-dba-what-makes-a-process-simple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/10/17/the-lone-dba-what-makes-a-process-simple/</feedburner:origLink></item>
		<item>
		<title>What’s holding up my SQL Server replication?</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/rL4k153O68g/</link>
		<comments>http://awanderingmind.com/2011/10/09/whats-holding-up-my-sql-server-replication/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 16:23:27 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Life As A DBA]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=641</guid>
		<description><![CDATA[In the last two weeks, my team at work has taken on support of a new application that makes heavy use of SQL Server replication technologies. This is one are I&#8217;ve never played around with much, so it has been a steep learning curve to say the least. One of the more common scenarios I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://awanderingmind.com/wp-content/uploads/2011/10/replicationtweet.jpg"><img src="http://awanderingmind.com/wp-content/uploads/2011/10/replicationtweet.jpg" alt="" title="replicationtweet" width="390" height="136" class="alignleft size-full wp-image-642" /></a><br />
In the last two weeks, my team at work has taken on support of a new application that makes heavy use of SQL Server replication technologies. This is one are I&#8217;ve never played around with much, so it has been a steep learning curve to say the least.</p>
<p>One of the more common scenarios I&#8217;ve run into is that the distribution agent encounters an error applying replicated transactions, causing the flow to stop dead in its tracks. From some research, it seems like in general this symptom indicates that the publisher and subscriber are out of sync, and usually the best option is to re-initialize the subscription. For various reasons, however, that is not an option in this case, so I&#8217;m left with resolving the issue causing the replication to fail. That means finding the actual command causing the failure, which was a little tricky.</p>
<p>I&#8217;ve found that the Replication Monitor GUI is not very helpful in this regard. What I tend to see is that it reports the transaction sequence number just fine, but the command text is less reliable. Mostly I&#8217;ve seen the last command in the batch, which (with my application) usually ends up being a simple &#8220;IF @@TRANCOUNT > 0 COMMIT&#8221; statement. Not very useful.</p>
<p>So instead, I&#8217;ve taken to using some good old T-SQL commands to get the information I want. The first is the <a href="http://msdn.microsoft.com/en-us/library/ms173427.aspx"><strong>sp_helpsubscriptionerrors</strong></a> stored procedure. This is executed at the Distributor and will return a list of errors for a specified subscription. The columns <code>error_text, xact_seqno,</code> and <code>command_id</code> are very useful, as they tell you the specific error message being encountered, as well as the transaction and command that are causing the problem.</p>
<p>Once we have this information, we can use the <a href="http://msdn.microsoft.com/en-us/library/ms176109.aspx"><strong>sp_browsereplcmds</strong></a> stored procedure to actually view the command(s) causing the issue. While you could feed it both the transaction sequence number (usually the same for <code>@xact_seqno_start</code> and <code>@xact_seqno_end</code>) and the command ID (<code>@command_id</code>), I find that it&#8217;s most helpful leaving the command ID out. This way you can see the entire transaction&#8217;s worth of commands (including the offender), giving you some good context to evaluate how to resolve the problem.</p>
<p>As for actually resolving the problem, well that of course depends upon what the root cause of the issue is. In our case, it seems that most times the problem lies with some developer deleting or adding a row at the subscriber, causing data validation errors. It&#8217;s a painful process, which is why our response is usually &#8220;Hey Mr. Developer, you deleted this row and now it&#8217;s causing problems. Please let us know when you&#8217;ve recreated the row and we&#8217;ll restart replication.&#8221; Let people fix their own problems.</p>
<p>I&#8217;m sure I&#8217;ll blog more on the subject as I encounter other problems and learn more about supporting replication.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/10/09/whats-holding-up-my-sql-server-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/10/09/whats-holding-up-my-sql-server-replication/</feedburner:origLink></item>
		<item>
		<title>The Lone DBA – Are Your Processes Repeatable?</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/IxRePU2wB9E/</link>
		<comments>http://awanderingmind.com/2011/08/29/the-lone-dba-are-your-processes-repeatable/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 10:30:42 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Life As A DBA]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[The Lone DBA]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=634</guid>
		<description><![CDATA[This post is the second in an ongoing series about how to survive as the only DBA in your organization. Since October of last year, I&#8217;ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It&#8217;s a great team of seasoned professionals, but not a single other DBA. As [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the second in an <a href="http://awanderingmind.com/category/sql/the-lone-dba/">ongoing series</a> about how to survive as the only DBA in your organization. Since October of last year, I&#8217;ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It&#8217;s a great team of seasoned professionals, but not a single other DBA. As a result, I&#8217;ve had to think very carefully about how I go about my daily work, so as to give our customers consistently good service, while still allowing those without a lot of SQL Server related knowledge to pick up my work when I&#8217;m not available.</p>
<h3>Design for next time, not this time</h3>
<p>When you get a request to do something, say, restore a database and give a team some access, do you just click through the GUI quickly to get the job done, then move on? Or do you consider how you can design the process so that it can be repeated over and over again with the same result?</p>
<p>Before you answer that question, let&#8217;s consider <strong>why we&#8217;d want a process to be repeatable</strong>, especially as a lone DBA:</p>
<ul>
<li><strong>It minimizes the work needed to take care of similar requests in the future.</strong> Instead of starting from scratch, you can re-use existing code or knowledge. You therefore have more time to work on other, more important (but perhaps less urgent) items.</li>
<li><strong>It results in consistent service to the client.</strong> The same input (&#8220;Please restore this database and grant me access.&#8221;) should always result in the same output (the database is restored to the right server, and the right permissions are given). The client always gets what they want, and it is delivered in the same manner.</li>
<li><strong>It allows us to delegate effectively.</strong>It&#8217;s much easier for a junior team member to walk through a well thought process than to have a request thrown at them and told to figure it out (which usually results in a stream of questions, followed by a gruff &#8220;Oh jeez I&#8217;ll just do it myself, it&#8217;ll be faster&#8221;). Now you can focus on the work that really requires a DBA toolset, instead of boring administrative tasks.</li>
</ul>
<p>Still think the processes you put in place don&#8217;t need to be repeatable? Perhaps you should read <a href="http://awanderingmind.com/2011/08/22/building-a-dba-team-why-your-way-may-not-be-the-best/">the first post in this series</a>, and remind yourself of the ramifications of blindly doing things your way.</p>
<p>Moving on, let&#8217;s examine the characteristics of a good, repeatable process:</p>
<ul>
<li><strong>Simple</strong> &#8211; the process should accomplish what the intended result is, with a minimum of fuss and effort, with no unecessary complexity in terms of how the process works.</li>
<li><strong>Automated</strong> &#8211; the process should require as little manual intervention as possible. If there are no steps requiring human decision making, then it should only require our help when something goes wrong.</li>
<li><strong>Documented</strong> &#8211; the process should be clearly described, both in terms of how to complete it, as well as how it accomplishes our goals (from a technical perspective).</li>
<li><strong>Generic</strong> &#8211; the process should be designed such that it can be tweaked at run time (to use programming lingo) to meet varying needs, as opposed to requiring lots of manual intervention.</li>
</ul>
<p>In the next few posts in this series we&#8217;ll examine each of these in more detail. Please let me know in the comments if you can think of any other required traits of a repeatable process!</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/08/29/the-lone-dba-are-your-processes-repeatable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/08/29/the-lone-dba-are-your-processes-repeatable/</feedburner:origLink></item>
		<item>
		<title>The Lone DBA – Why Your Way May Not Be The Best</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/v7xWJvYTKac/</link>
		<comments>http://awanderingmind.com/2011/08/22/building-a-dba-team-why-your-way-may-not-be-the-best/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 10:30:58 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Life As A DBA]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Processes]]></category>
		<category><![CDATA[Teamwork]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=615</guid>
		<description><![CDATA[This post is the first in an ongoing series about how to survive as the only DBA in your organization. Since October of last year, I&#8217;ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It&#8217;s a great team of seasoned professionals, but not a single other DBA. As [...]]]></description>
			<content:encoded><![CDATA[<p>This post is the first in an <a href="http://awanderingmind.com/category/sql/the-lone-dba/">ongoing series</a> about how to survive as the only DBA in your organization. Since October of last year, I&#8217;ve been assigned to a team that is responsible for owning and maintaining the development infrastructure. It&#8217;s a great team of seasoned professionals, but not a single other DBA. As a result, I&#8217;ve had to think very carefully about how I go about my daily work, so as to give our customers consistently good service, while still allowing those without a lot of SQL Server related knowledge to pick up my work when I&#8217;m not available.</p>
<h3>We don&#8217;t need no stinkin&#8217; team&#8230;</h3>
<p>Sure, who needs teammates? I mean, we don&#8217;t need to take vacations, have sick days, or even take breaks to go workout at the gym or go for a run. We can just work all day, handling everything ourselves. And if we&#8217;re on vacation, we can always take our laptops with us, and tether our Crackberry to dial in to the network when things need to get done.</p>
<p>If you&#8217;re not laughing out loud, or at least cringing at what the last paragraph describes, I&#8217;d like to recommend <a href="http://www.workaholics-anonymous.org/page.php?page=home">a website for you to browse</a>.</p>
<p>Hopefully we can all agree that we all need time off now and then. And perhaps the occasional unplanned absence will happen, despite our best attempts to be the Cal Ripken Jr. of our office and keep our no-sick-day streak alive. And when that time comes, would you rather have your customers needs smoothly handled without pause, or would you like them passed around from team to team like the proverbial hot potato? Or even better, given that wonderful &#8220;Well, can it wait until so-and-so is back in the office?&#8221; question. I don&#8217;t know about you, but I <em>hate</em> it when I hear that question.</p>
<h3>You can be the man, without being the man all the time</h3>
<p>We all like to feel important and desired; after all, it&#8217;s just a <a href="http://en.wikipedia.org/wiki/Maslow's_hierarchy_of_needs">natural human need</a>. Early in my career I craved the spotlight and guarded my knowledge carefully, lest someone else take my spot as &#8220;go to guy&#8221;. It felt great to always be the one to solve issues and get things done. Well, at least it felt great until I came home three hours late and faced a cold dinner plate, or spent the day after Christmas troubleshooting over a dialup connection, while my wife and relatives opened presents in the other room.</p>
<p>At some point in our careers, I believe strongly we have to choose one of two paths:</p>
<ol>
<li>We can keep being the lone wolf who does things our way all the time, however we please, because we&#8217;re the only one who ever knows how to do them.</li>
<li>We can compromise our rigid principles, stop being stubborn, and learn that sometimes we have to consider if our teammates could do things how we&#8217;d do them.</li>
</ol>
<p>Allow me to clarify that last option a bit: Just because you&#8217;re a whiz with T-SQL and could whip up a one-time script to update ten <del>thousand</del>million records for that cute girl / guy in Operations doesn&#8217;t mean that you should. Because like any reasonable customer, if it&#8217;s done once, they&#8217;ll expect it can be done again, whether you&#8217;re there or not. And if this person / group is an important consumer of your services, chances are you&#8217;ll be getting a phone call from your teammate (or your boss) when you&#8217;re at your kid&#8217;s Scout camp, asking how to modify your query (because you at least saved that and let the team know where it is, right?).</p>
<p>If your whole team is full of crack T-SQL programmers, good for you, go wild (and you are one lucky SOB); otherwise, don&#8217;t do something unless you&#8217;ve made sure your backup can do it just as well. Maybe you feel comfortable running a series of scripts to setup replication every time you restore a database, but how about the guy sitting next to you who spent most of his career as a Windows sysadmin? I&#8217;m not suggesting that you can&#8217;t do complex things that can&#8217;t be repeated with a few clicks, but do consider how to make the processes easier for those without your experience. Talk to your teammates and make sure you build a process they&#8217;ll be able to support. Maybe they&#8217;re not comfortable running scripts in Management Studio, but perhaps a wrapper Posh script that prompts them for the necessary information and takes care of things under the covers would be fine.</p>
<p>Believe me, you&#8217;ll still be appreciated when you return from that much-needed vacation, perhaps even more so because you made sure your customer would experience the same great service when you&#8217;re not there. And there will always be new challenges to tackle where you can flex your muscles to remind everyone just how good you are. Just remember to bring your teammates along too.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/08/22/building-a-dba-team-why-your-way-may-not-be-the-best/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/08/22/building-a-dba-team-why-your-way-may-not-be-the-best/</feedburner:origLink></item>
		<item>
		<title>A Tale of Coding Horror – T-SQL Tuesday #21</title>
		<link>http://feedproxy.google.com/~r/awanderingmind/Fzqz/~3/8Khu_cjPx1s/</link>
		<comments>http://awanderingmind.com/2011/08/10/a-tale-of-coding-horror-t-sql-tuesday-21/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 12:30:48 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[T-SQL Tuesday]]></category>

		<guid isPermaLink="false">http://awanderingmind.com/?p=599</guid>
		<description><![CDATA[It&#8217;s time for T-SQL Tuesday again, that great community event started by Adam Machanic (Blog &#124; Twitter) where bloggers all over write about the wonders of SQL. This month&#8217;s topic: Crap code, and boy do I have a lot to choose from. It was hard to pick one example (my early days as a programmer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlblog.com/blogs/adam_machanic/archive/2011/08/03/t-sql-tuesday-21-a-day-late-and-totally-full-of-it.aspx"><div id="attachment_600" class="wp-caption alignleft" style="width: 310px"><img src="http://awanderingmind.com/wp-content/uploads/2011/08/tsqltuesday.jpg" alt="" title="tsqltuesday" width="300" height="300" class="size-full wp-image-600" /><p class="wp-caption-text">T-SQL Wednesday</p></div></a><br />
It&#8217;s time for T-SQL Tuesday again, that great community event started by Adam Machanic (<a href="http://sqlblog.com/blogs/adam_machanic/default.aspx">Blog</a> | <a href="http://twitter.com/adammachanic">Twitter</a>) where bloggers all over write about the wonders of SQL. This month&#8217;s topic: Crap code, and boy do I have a lot to choose from. It was hard to pick one example (my early days as a programmer were riddled with bad decisions), but I finally decided on writing about my first ever software release.</p>
<h3>A long time ago, in a building far far away&#8230;</h3>
<p>&#8230;there was a young man who had just joined the ranks of an operations group at a financial firm. He had quit his job as a retail store manager (a job he only took because nothing was available in his chosen field of social services) and taken a temp assignment as a means to pay the bills. His job was simple: run reports from various systems (a mainframe green-screen system, a SQL database), carry some checks around, and various other menial tasks. But still, it was nice to be out of the 12 hour workdays of retail.</p>
<p>Soon after beginning work, the man noticed that a great deal of his work amounted to punching in a bunch of repeat keystrokes and waiting for things to print. As a result, he quickly learned the ways of ExtraBASIC, and wrote macros to tab around the terminal screens. He also learned how to use the query designer in Access, so that he could quickly get data out of a database when requested by various teams. Within a few months, word had spread of the reporting wizardry, and he was offered a permanent job within the group.</p>
<h3>The First Fail</h3>
<p>While not officially a programmer, he was given several tasks around building utilities for the group he worked with. Abandoning Access for greener pastures, he downloaded Visual Basic Express and began whipping together tools. Requirements shifted on a daily basis; after all, the ops groups weren&#8217;t used to having their own private coder at their beck and call. The young man enjoyed his work, if only because it kept him out of the daily grind of operational processing. And what with the simple drag-and-drop designer, the actual coding was minimal. A click here, a quick line or two of code there, and voila, a functioning application. Naturally Access / Jet was still used as the back end database, since that was what was available.</p>
<p>When it came time to roll out the application, the team was gathered and a demo given. Everything worked fine, and the decision was made to start using the new app right away. Everything was in place, and the go-ahead given. But soon after the use started, problems began appearing. Data wasn&#8217;t being consistantly updated, operations took a long time to complete, results weren&#8217;t as expected. After several hours, the decision was made to go back to the previous method of operation.</p>
<h3>When at first you don&#8217;t succeed, try, and fail, again&#8230;</h3>
<p>The young man was discouraged by this early setback, but he learned from his mistakes. At least until the next release, which included such wonderful upgrades as using MySQL as the back-end (on a dusty desktop box) and optimized in-line SQL (as opposed to GUI generated code). It fared much better, lasting several days before major issues were uncovered. </p>
<p>Within several months, he was offered a job as a full time programmer. He quickly churned out code, and his teammates loved his work ethic. What they didn&#8217;t love was his propensity for writing overly complex, convoluted code, which also conveniently was bereft of any comments. He also had a knack for finding and leveraging new technologies, such as an open source job scheduler, SQL Server Express (installed on that same dusty little box), and random .NET classes pulled off the internet. This was great when it came to functionality, and the business units were pleased. That is, until he was on vacation and something went <strong>bump</strong>, and they were forced into manual processing while the man&#8217;s teammates frantically dug through .vb files. </p>
<h3>Since then&#8230;</h3>
<p>I&#8217;ve learned quite a bit about writing better code since that first debacle, with many, many more missteps along the way. I&#8217;ve written code that was far, far too complex for what it needed to be (think a whole class for a simple calculation), scaled terribly (a linked server as a source for an 8+ hour ETL process that involved three layers of nested cursors), and was completely undocumented. But I&#8217;ve also grown tremendously as a programmer, learning lessons such as:</p>
<ol>
<li>Write simple, reusable code. Don&#8217;t try and be clever; just write what is needed and nothing more.</li>
<li>Don&#8217;t rely on GUI generated code. Use it as a basis, but understand what it does and tweak it to better suit your needs. I yell at developers constantly because they try and do something via the Management Studio interface instead of writing the code. Writing encourages understanding, which in turn encourages better code.</li>
<li>Have solid test plans in place, and be methodical about following them.</li>
<li>Code for future scale, not current. I still refer people to <a href="http://infolab.stanford.edu/~backrub/google.html">the paper written by the Google founders years ago</a>, where they explicitly acknowledge and plan for greatly increasing activity.</li>
<li>Document your code to the teeth. Some day in the future, long after you&#8217;ve moved on and requirements documents are long lost, the code will break, or need to be updated, and your comments will be the only information available about why things were done the way they were. I don&#8217;t know about you but I&#8217;d rather have people singing my praises after I&#8217;m gone, as opposed to throwing strings of four letter words (as well as various hard objects) at my picture.</li>
</ol>
<p>I still cringe when I look back on those early days. I&#8217;m actually good friends with the guy who was my first development manager, and every time he mentions the name of some application I wrote, I scowl and apologize for having given birth to such junk.  Everyone writes code that makes their skin curl years later,  but what&#8217;s really important is that we strive to learn and improve our skills on a continuous basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://awanderingmind.com/2011/08/10/a-tale-of-coding-horror-t-sql-tuesday-21/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://awanderingmind.com/2011/08/10/a-tale-of-coding-horror-t-sql-tuesday-21/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.671 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-01-22 14:58:33 -->

