Blog Post

T-SQL Tuesday #31 – Logging

T-SQL Tuesday!It’s been a while since I’ve written for T-SQL Tuesday, but I couldn’t resist this month’s topic. Aaron Nelson (blog | @SQLvariant) is asking about logging, and it needn’t to pertain to SQL Server. I love transaction logs a lot, but there’s plenty of other logs in my life, the vast majority of which actually involve spreadsheets (woops – secret’s out!) I’ve been keeping data about a lot of aspects of my life for quite a while now. I’m not sure why I started doing it, but it’s come in handy a few times now. Here’s a few examples:

To-Do List
I’m a huge fan of getting things done, and I can’t think of any better way of keeping track of what’s done and what still needs doing than by logging it all. For a little over 3 years now I’ve been doing this with Remember The Milk, which is by far the most versatile to-do list I’ve ever seen. They’ve got an awesome website and great apps, so my list is always everywhere that I am.

Work Notes
At my first job out of college, I was a big fan of notebooks – actual paper notebooks. My notebook and I were inseparable; it came with me to every meeting and I’d write pretty much everything in there. After 4 years at that company, I had a collection of about 20 notebooks. Looking at all that paper gives a great sense of accomplishment, but actually getting to the data it contains is pretty difficult. I’d remember writing something down, but would have to thumb through tons of pages before I found it. When I started my second job, I decided to use Microsoft OneNote in place of my paper notebooks. Not only can I search through all my data much more quickly, but I can also copy and paste relevant scripts, emails, and other info into it.

Phone Usage
I’ve been keeping track of how many minutes, text messages, and KB of data I’ve consumed ever since I got a cel phone. This information has proven to be a great tool whenever I need to get a new phone, as I can be sure to select a plan appropriately sized to my usage pattern. Surprise – I’ve never needed the largest plan…

Vehicle Gas Mileage
Every time I put gas in my car I write my odometer reading on the receipt. At home, I have a spreadsheet with the date, mileage, and how much gas I’ve put in my car. From this I can calculate my gas mileage, and over time the numbers can be very interesting. It’s also a great way to keep track of how much you drive in general. Some insurance companies even offer a discount if you can prove you drive below a certain number of miles each year. Records like this are exactly what my agent is looking for.

Utility Bills
Much has been written about having a baseline for your server so you can easily identify when performance is deviating from the norm. Similarly, I like to have a baseline for my utility usage. I have a spreadsheet of all the pertinent numbers off each of my utility bills – the billing period dates, meter readings, consumption, rates, and taxes. Basically all the numbers needed to calculate my total bill. This makes it very easy to see usage trends, as well as judge the effect of rate increases. Back when I worked for a city, I saw several instances of people who didn’t notice their water bills slowly creeping up each month – typically due to a slow leak. Eventually the leak would grow and remain unnoticed until their water bill would reach several hundred dollars in a month. By tracking my meter myself, I have a good chance of noticing these issues much more quickly.

These are just some of the logs I keep – others are much less interesting. I mentioned earlier that most of this is done in spreadsheets instead of a database. If you’re curious, I do it that way because it’s easier. I don’t have a ton of data (most of these spreadsheets grow by 1 row per month) and I never got around to loading it into SQL Server. Hopefully some day I’ll have the time, but until then I’ll just abuse Excel.

Thanks Aaron for a very interesting topic! I look forward to seeing what others contributed.

Related Posts

By Bob Pusateri

Bob Pusateri is a Microsoft Data Platform MVP, Microsoft Certified Master of SQL Server, speaker, blogger, volunteer, and author who loves finding new and exciting ways to break and fix things. He works as a consultant and architect, specializing in data, virtualization, and cloud technologies.

Leave a Reply

Your email address will not be published.