Posts Tagged ‘bestpractices’

That’s not my job…maybe…

October 25th, 2010
Not my job

I found myself in a small, most likely very insignificant little situation at work today. When I looked back on it afterward, I felt unexpectedly fresh; the kind of fresh one experiences after an epiphany of minor proportions. I had to reflect and really think twice about why seemingly doing nothing more than “my job” left me feeling like a better DBA and person in general.

In this particular situation, I had two responsibilities; to ensure the code conformed to company standards/syntax, and assure the procedure itself affected the expected number of records BEFORE it got run against prod. Simple enough right? It’s not my role (at this point in the process at least) to ensure correct logic is being followed. After a 9-hour day (not gargantuan by DBA standards, but long enough to be exhausted) a script came across my desk for review. This script contained an innocent enough local variable, “@CustomerID”. This local variable was declared but never assigned a value. Fifteen lines later down the script, @Customer was checked to see if it was NOT NULL; and if so, an UPDATE statement was run. Looking it over a 2nd time, the logical error of it never being able to run the UPDATE became clear; yet syntactically it was correct, and company standards were all being met. My options flashed across my mind. Do “my job” and advance it forward; or cause yourself and perhaps several others to have to stay late at work to fix the script and send it back through the pipeline?

I suppose I wouldn’t be writing about this had I taken the easy way out. And I must stress, this is NOT about patting myself on the back. This was a very small thing in reality. I rejected the ticket for the logic error despite that not being part of what I was asked to do in this situation. A VP came by my desk 5 mins later and inquired immediately about why I rejected it. After explaining the logic error, his initial annoyance at his guys having to stay late due to me bouncing the ticket, disappeared completely. He thanked me for my diligence and basically said that if his team were more careful in the first place, they’d be home by now. Small victory for the Grateful DBA.

As I drove home a bit later, it occurred to me just how good it felt to go that extra step. How the satisfaction of doing the “right thing” outweighed the small irritation of putting in an extra 45 mins on a Monday evening. How it not only was the best thing for the organization, but bonus, was probably a fairly good thing for my career.

So I ask; did you bite your tongue today when something came across your desk that wasn’t your job? What did you do extra today?

Have a grateful day…Troy

Tags: ,
Posted in Best Practices, Musings | Comments (2)

What NOT To Do. True SQL Confessions.

February 24th, 2010

I just love irony…
Irony

Flipping through the channel guide last night and I came across TLC’s What Not to Wear. Reminded me of the hilarious meme floating around the SQL Twitter community yesterday regarding SQL confessions. Basically, we were “baring our soul” and confessing to committing some of the cardinal of database sins. And while the conversation was 110% tongue-in-cheek, it occurred to me that just like the yentas on TLC telling you what not to wear, this thread is in essence an excellent guide on what NOT to do with SQL. Seriously, here we have some of the best SQL minds in the world not only having a blast and amusing the crap out of anyone following the hashtag, but also teaching us valuable lessons. Albeit in a backwards offhanded manner, but nonetheless I see a tremendous amount of wisdom if one can remember to look at it correctly.

So, I repost just a small percentage of the wackiness that ensued yesterday with a few stipulations. First and MOST IMPORTANT; this is not a list of advice from me. PLEASE don’t go running into the IT Director’s office and insist all your company’s clients databases get converted to Access, just because the Grateful DBA posted it. But…maybe it will get you to think once or twice when a client is starting to hint that maybe they’d prefer an Access solution because they’ve already forked out coin for Office.

Second, while I’m all for giving credit where credit is due…99% of the time, I think this may be the exception to the rule. While this is all in good fun, I shudder at the thought of some lazy slob happening upon this blog and seeing a highly respected MVP’s name next to something outrageously ridiculous and taking it out of context. To avoid any possibility of that, I’m not including any author names here. Understand these are all “overheards,” and only a couple of them were written by myself. If you’re truly industrious I suppose you could do Twitter searches for the phrases below and determine who wrote them. If you do, I say you have too much time on your hands.

So, enjoy this list of true SQL confessions. And like I stated, while these are all meant as jokes, I honestly believe there’s a lot to be gained by slapping on the ol’ irony glasses and examining exactly what they’re trying to tell you.

  • “I shrunk a database last week.”
  • “I ran DBCC CHECKDB in production without telling anyone.”
  • “I go in the server room and pull random wires as soon as I go off call.”
  • “I sneak cursors into others’ code.”
  • “I have a production account whose username and password are the same.”
  • “I have tlogs on RAID 5.”
  • “My sa password is sa.”
  • “A query I wrote yesterday not only uses dynamic sql but in a loop executing it hundreds of times.”
  • “I’ve made developers sysadmin in production so they could push code changes without testing them.”
  • “I used rollback within a trigger.”
  • “I eat bacon 3 meals a day.”
  • “I sometimes do exactly the thing I tell you not to in my blogs.”
  • “I run CHECKPOINT every 2 seconds.”
  • “I used a cross join to fill a table variable.”
  • “When my tempdb drive fills up, I hook up a USB drive and create a new tempdb file there.”
  • “I randomly kill other people’s queries, just to make my day interesting.”
  • “I’ve turned off database mirroring on all production sql servers as a quick fix for performance issues.”
  • “I’m not really a DBA…but I did stay at a Holiday Inn Express last night.”
  • “I am not a DBA, but I sleep with one.
  • “I don’t enforce refferential integrity . Chaos is much more fun.”
  • “I play Lady Gaga without remorse before presentations now.” (Breaking my rule; giving @SQLChicken credit for this one)
  • “I’ve given a developer db_owner just to shut them up.”
  • “I like clustered GUIDs. They make it really easy to speed up a database. By unclustering them.”
  • “I tried installing SQL 2008 on Microsoft Bob.”

Have a Grateful day…Troy

Tags: , ,
Posted in Best Practices | Comments (3)

Get Adobe Flash player