T-SQL Tuesday #022 – Data Presentation

September’s T-SQL Tuesday is brought to us by Robert Pearl (Blog|Twitter), and he has chosen Data Presentation as the topic for this month’s T-SQL Tuesday. I shuddered after seeing this topic because it brought to mind an experience where the separation of data and presentation was violated.

I received an email from the boss saying he had been querying a particular database. He wanted the leading zeros removed from all numeric values.

I said that’s no problem, we’ll just modify the query tool to trim leading zeros. The previous boss wanted to see data exactly as it was stored in the database, thus he didn’t want leading zeros trimmed. But no problem Mr. Boss Du Jour, we can change that. Or better yet, we can offer it as an option in a checkbox. Because who knows what the next boss will want (okay, I didn’t say this last part, I just thought it to myself).

The boss countered “No, don’t modify the query tool. I also want to see the data as it is stored in the database. And the way I want it stored in the database is with the leading zeros trimmed.”

I explained that there were specifications written years before detailing that numbers were to be stored in that database exactly as they were received from data providers. There were a number of reasons for this, the most crucial being that part of our service offering was the ability to rate data from our various sources by a range of metrics. This particular database was used for that product offering. Modifying the numeric values by removing leading zeros would corrupt that process.

In the end, none of my arguments mattered. I could tell it had become a point of pride for the boss to win this no matter what. I asked why this was so important. For example, did he have storage or performance concerns. But his answer was just “It looks better without leading zeros.”

After that, there were questions I thought about asking but didn’t. Like if he thought it would look nicer if he could see the database at the byte level. Or if he had an opinion on whether big-endian or little-endian looks prettier. Or if he’d be happier with a mauve database.

Or, how we were supposed to put the zeros back when the next boss asks for them.

Anyway, I know I mentioned this in a prior post, but it’s probably worth repeating… when asked to do certain tasks (such as those regarding presentation), at least consider whether it’s something that belongs in the database or at another level.

Thanks to Robert Pearl for hosting T-SQL Tuesday #22, especially when he was asked to host earlier than planned! And thanks to Adam Machanic (Blog|Twitter) for creating this monthly blog event and keeping it going!

About Noel McKinney

Noel McKinney is the administrator of this website.
This entry was posted in T-SQL Tuesday and tagged , . Bookmark the permalink.

4 Responses to T-SQL Tuesday #022 – Data Presentation

  1. John Halunen says:

    Mauve, definitely mauve. Nice post Noel.

  2. Matt Velic says:

    Man, oh, man. I’ve had this boss too. Honestly, I always want to teach why things are the way they are too, but sometimes it just doesn’t matter…

  3. Chuck Rummel says:

    It’s definitely a delicate situation when new higher ups start asking (or demanding) things without knowing the whole story. The longer I’m at my current position the more I feel like I’m giving history lessons to new hires. What feels worse is occasionally when I’m trying to explain something and I realize, as I’m doing so, that it’s starting to sound like an excuse instead of a reason.

    But I feel it’s always good to verify someone understands the impact of what they’re asking for – in your case the “how do we put the zeros back for the next guy” would have been the clincher for me. Maybe I would have proposed a db “enhancement” to have them query a view that did the trimming while leaving the original data untouched.

Comments are closed.