Straining at Gnats

Here in the south (I live in Alabama) we have a saying “quit straining at gnats”. A gnat, by the way, is a very tiny bug that proliferates during the summer and tends to fly in your face when you walk outdoors. The saying essentially means “you’re working very hard to get rid of something very small”.

In Episode 300 of Dot Net Rocks (a great episode) Richard Campbell tells a great story. The short version is Richard is called in to look at a computer that’s having problems. It’s the mid 80’s or so, and this PC is responsible for downloading financial info. Every hour the computer reboots itself and they have to go start it all back up. He says “I can fix it, but it’ll cost you 3 grand”. Client sputters and says they’ll think about it.

Two weeks later he gets the call “OK, you got the 3 grand, come fix it.” So on the way to the client he stops and spends 1500 bucks on a new PC, puts it in place at the client, copies all the old software over and boom it’s up and running perfectly. As he’s walking out the door, check in hand, he’s asked “what was wrong with it?” “Heck if I know.” Richard replies. “But the problems fixed.”

It’s a great story (and much funnier when you hear Richard tell it), but it illustrates a great point. All too often we obsess over some problem, and lose sight of the desired result. All too often we focus on some piece of code, trying to come up with the most “elegant” solution, or frustrate ourselves over some piece of code instead of tossing it and rewriting.

I’m not saying write bad code, or write sloppy code in a hurry just to get it done. I am saying when you run across a problem, don’t get so invested in it that you don’t see alternatives. Time and again I see a developer getting stuck on a problem, trying to fix some arcane piece of code, or spending hours to get that extra millisecond from a SQL query.

When you run across that road block, take some time. Push back from your computer and think for a moment. Think what the true outcome of your application is supposed to be. Not “what will the program do” but “what will the program do for the user???” Think about how best to achieve the users goals.

As Campbell pointed out several times in the episode, when you are writing software for a business it’s all about making money. Your program should either make or save the company money in some fashion. Whether it’s by crunching numbers in a faster, more efficient way than a human could, by providing information in a more timely fashion, or any of a thousand other scenarios. Never lose sight of the fact your software is to provide a solution, and not being written for artistic purposes.

Don’t get so lost in the code that you wind up straining at gnats.

Happy Anniversary

I typically don’t post much in the way of personal stuff here on my tech blog, but I had to take a moment to wish my beloved wife “Ammie” Happy Anniversary! Eleven years ago today my best friend and I walked down the aisle, which was an adventure in and of itself. Here’s a hint for all you guys out there: if you are going to get baptized together the day before the ceremony, make sure your bride to be’s ex-boyfriend isn’t in charge of filling up the baptistery!

My wife always wanted to have a baptism ceremony with her groom, so the day before they wedding we got baptized together. Let me set the scene for you. It’s December, and even though we live in the sunny south it was still COLD that day. As in 33 degrees Fahrenheit for the high. Oh, and winds from the north at 15 miles per hour, which made the wind chill factor “way on down there” as we say.

Seems my wife’s ex thought it might be a good idea not to fill the thing ahead of time and let it get to room temp. Oh no, he thought we needed the water good and fresh. Fresh from the icy cold well they used to fill it. And did I mention it seems that just coincidentally the heater for the water wasn’t working that day?

So when the pastor, my bride and I got into the water, little icebergs were floating all around us. And then just as the pastor is about start the dunking “Brother Bill” who was on stage, got a little befuddled about his part. He was supposed to give a little talk after our dunking, but got confused and started on his fifteen minute monologue while we were still standing in the frozen pond they called a baptistery.

Someone finally drug Brother Bill off stage and we got on with the dunking. More fun followed, it seems when you exited the pool, the door led outside. Yes, you read that right, outside. It seems the building designer didn’t want wet robes dripping on the carpet, and thus in bare feet and dripping wet robes we walked down the long side of the church, then back around the front and back in to the bathrooms.

The fun didn’t end there though, we still had the ceremony to get through. At the end of each pew were candles and garland. My wife had a long veil on her gown. Can you guess where this is going? About half way down I saw a little flare up as the thing began to smolder. Fortunately just as quickly I saw a pair of hands, I still have no idea who it was, reach out and snuff it out. Fortunately the happy bride was blissfully unaware as she continued her march.

Disaster was almost repeated during the candle ceremony on stage, you know the one where we take two candles and light one in the middle then blow ours out? This time I was on hand, she was so excited she brought her candle right to her face forgetting her veil, I had to stop her before the open flame reached it.

I had my brain dead moment of glory as well. We were rushed through our ceremony, photos, reception, and by the time we left we were both starving. We stopped at a drive through window, and my new wife asked me to get some cold meds out of the back. Yes, the cold dunking in the baptistery had left her sick! Well I was so excited I sat my 32 ounce cup of ice tea on the dash in front of her, then jumped out. I have a stick shift. Guess what I didn’t do?

Yup, take it out of gear. I stalled it out and large cup of tea went floop right in her lap. Icy cold again!

It all turned out well though. Eleven long years, two kids and a mortgage later we are still happily married and going strong. I have to give a lot of credit to my long suffering wife for putting up with me, listening to my ramblings about the .Net framework or some SQL function, and staring at the back of my head while I worked on blog posts or learned some new tech.

Happy Anniversary Ammie! Love ya babe!

Happy Holidays

Ah, the holidays! Time for carolers, festive trees, and eggnog. And, time to squeeze in all that vacation I haven’t been able to take all year!

Like a lot of folks I’ve been enjoying some time off, spending time with the family, fighting the crowds for a little last minute shopping, and catching up on some honey-do’s. And, for a change, staying away from the old PC for a bit.

But I wanted to take a moment to thank everyone for visiting, and wish you all a safe and happy holiday season.

  –Arcane Code

SQL Server 2005 Learning Resources

I’ve been spending a lot of time lately in the SQL Server realm, learning all I can about it as both a database and business intelligence platform. Turns out to be a far more complex, and fascinating subject than I’d first imagined. I thought that you too might find some of the same resources I’ve been using useful. All of these are free, which is a great price.

Rather than putting them all here, I’ve updated my Arcane Links page ( ) with a new section on SQL Server 2005 Resources. Over the holidays I plan to update the links page with fresher links, local user groups, etc. I’m also working on learning SQL Server 2008 as well, so look for those links upcoming shortly.

A timely mention, the RunAsRadio that was released this week (episode 36, see the RunAsRadio link in the links page) has an interview with Kimberly Tripp and Paul Randal. Not only was it a great interview, they let it slip they’re actually considering doing a show. If you’d like to see a SQL Server show, please leave a comment over on Carl Franklin’s blog ( ) and let them know. Personally I’m thrilled, there’s a lot of good shows on Visual Studio but only one good one that I know of for SQL Server, SQL Server Down Under (again see my links page). If you know of other shows let me know by leaving a comment here. I figure there’s plenty of room for more and Kim and Paul would be a great duo.

Over time my posts will catch up with what I’m learning, and I’ll start getting more into SQL Server content as time goes by. Meanwhile check out the links and learn along with me.

Happy Anniversary Commodore 64!

According to a report in CNN ( ), folks are gathering today to celebrate the 25th anniversary of the Commodore 64 computer. Those of you under 30 may not remember this gem of a machine. It wasn’t my first computer, but it was probably my favorite. The amount of hacking and modding you could do with these things was incredible. I cut my teeth on BBS’s (Bulletin Board Systems) using my 300 baud modem. Yes, 300 baud, if you happen to recall what a baud is. For comparison, 56,000 baud (56k) is about the fastest dial in you can get today, and then it jumps to broadband.

I remember way back when I was the third person in my area to upgrade to a 1200 baud modem. And would you believe at first I didn’t like it? With my old 300 I could easily read my e-mail as it scrolled onto the screen. With the 1200 it zipped by so fast I had to go learn all the message scrolling commands for the various BBS’s I dialed into.

I’m something of a packrat; I still have a lot of “ancient” computers in my home-office closet. TRS-80’s, Radio Shack Color Computers, parts of a Timex Sinclair, and a Commodore Amiga. But the one that’s still setup on my desk is a Commodore 128, with a stack of drives, software, and even a Commodore 1702 monitor. I find it relaxing to fire it up every so often and play some old fashioned arcade games, or play some of that old midi music.

Happy Anniversary Commodore 64!

Arcane Thoughts – Firefox Got It Right

We had a nerd lunch today, 5 developers at the round table of my favorite restaurant, Richards BBQ & Grill. We talked about a lot of different things, and spent a while ranting on what I can only describe as the narcissism of companies taking over our system trays with their stupid applications.

I’m not saying nothing should ever go in the tray. Software that needs to run 100% of the time to wait for my command, like SlickRun or TouchCursor, should have an easy interface and the tray makes sense. But there’s a lot of software that runs, but doesn’t need to.

Why, for example, does Adobe Reader need to install it’s applet into the system tray? What value does it add? Checking for updates? Yeesh, why do you have to run 100% of the time on the off chance an update might come out?

How about all the hardware makers who want to install interfaces to their hardware? Why do I need another program running all the time on the off chance I might perhaps possibly maybe want to tweak a setting? Isn’t that what Control Panel is for?

Firefox, on the other hand, got it right. When you launch the application, it quietly checks for updates in the background. When it’s downloaded them and has them ready to install, a little dialog pops up and asks if you’d like to restart Firefox to take advantage of the new updates. If no, it just says “Okey Dokey, I’ll install them the next time you run Firefox”. And that’s it, no harassment; it only runs when I run the app! No annoying system tray icon for Firefox.

There’s no reason why other tools couldn’t follow the same model. Adobe Reader for example, when I launch the reader, at that time and only at that time, it should head off in the background and see if there’s an update. Let me know if there is, and away we go. But if it’s six months between the time I run the program, then just lie dormant on my hard drive, don’t suck up my valuable CPU and RAM with your app that adds no real value to my system.

Well, at least there’s one company out there who knows how to handle updates correctly. I’d love to hear your examples of good software. Software that handles updates correctly and respects your system resources. Let’s give these makers an “atta-boy”.

SQL Server Staging Tables – Truncate versus Delete

I’ve been reading a lot of books on SSIS (SQL Server Integration Services) and BI (Business Intelligence) over the course of the year. I want to pass along a little tidbit I haven’t seen in any of them. I’ll preface this by stating our staging tables and data warehouse are all in SQL Server 2005.

Our process is probably similar to others, we pull the data in, and if the warehouse needs to be updated we place the data into a staging table. At the end of the process we do a mass update (via a SQL statement) from the staging table to the main data warehouse tables we use for reporting. Then we delete the records in the staging table. Which seemed like a reasonable thing to do, but wound up getting us in a lot of trouble. Over the course of the last few months our run times for the SSIS job have gotten slower and slower and sloooooooooooooower. Our job was taking as long as 50 minutes to complete sometimes. One of our developers noticed the database seemed to be taking up a lot of space. He found a simple select count(*) was taking eight minutes on what was supposed to be an empty staging table.

Some research on the web explained what we were doing wrong. In one of my favorite SQL Server blogs, I want some Moore, blogger Mladen Prajdic has a great article on the differences between delete and truncate.

The solution then was to not perform a delete, but a truncate on our staging tables. We went ahead and manually issued a truncate on our staging tables, and saw an immediate beneift. Our average run time went from 50 minutes to 8 minutes!

I’m not sure why I haven’t seen this mentioned before, perhaps I just haven’t read the right blog or book yet. But I wanted to pass this along so you could be spared some of the headaches we went through. If your SSIS uses SQL Server 2005 tables, use a truncate and not a delete to avoid speed issues. Alternatively, at least make sure to run truncates on a regular basis to keep those staging areas cleaned out!

ITAC Lunch and Learn – Dec 4th

My friend and co-worker, Jeff W. Barnes, MVP will be speaking on Tuesday December the 4th at the Emmet O’Neal Library during lunch. His topic will be “The Future of .Net Development” which sounds pretty interesting. Come on out, here a good presentation and grab some lunch.

For more info, including registration info, see Jeff’s blog entry at

See ya’ll there!