T-SQL Tuesday #194 – Learning From Mistakes

The first T-SQL Tuesday invite of 2026 comes from Louis Davidson, asking to share a mistake others can learn from. We all make mistakes. Some have an immediate impact, and some creep up months or years down the road. I’d like to touch on an mistake from long ago with script versioning that wasn’t critical but still made me slap my forehead knowing it was easily preventable.

To read the full invite, click the T-SQL Tuesday logo to the right.

There Can Be Only One

For a set of tasks, I had a template script that was reused from time to time. After creating a change script based on the template, another associate was reviewing the script and pointed out an issue. They recognized the original template part of the script was doing something inefficiently and should be corrected. It wasn’t a big deal and was an easy change to make. I fixed the script, all was approved, and all was well.

Except it wasn’t. I fixed the script that needed to be approved and also updated the source-controlled template to use for next time. But I still had my own local copy of the template script that I failed to update, and that local copy is what I continued to use instead.

Eventually, it came to light that multiple scripts had gone out with the old version.

Don’t be a Hoarder

The lesson? Don’t hoard local versions of scripts and make sure what you have is up-to-date. Similarly, don’t be that guy that, years down the road, when someone asks, “Where’s the code for that?” the sarcastic but unfortunately accurate response is, “Oh, so-and-so has a copy of that on their old laptop.”

This concept is especially true if you’re the only one in your company who uses certain scripts or workflows. Why? Because when it’s time to move on to a new role, or you get hit by a bus and someone else has to step in, the next batter up will need a clue about what needs to be done. You can either have this information published and have somewhere to point them to or leave them in the dark and get peppered with questions.

Do “future” you a favor. Use source control and don’t hoard information.

Thanks for reading!

Leave a comment