Nov 292011


The DBA is my shepherd; I shall not want.

He maketh me to lie down in green Integration Services tasks:
he leadeth me beside the still SSDs.

He restoreth my filegroups:
he leadeth me in the paths of MS best practices for his sanity’s sake.

Yea, though I walk through the valley of the shadow of joins, I will fear no scans:
for thou art the optimizer; Thy indexes and statistics they comfort me.

Thou preparest a table before me in the presence of mine schemas:
thou anointest my database with DBCC CHECKDB;
my plan cache runneth over.

Surely consistency and integrity shall follow me all the days of my life:
and I will dwell in the house of the DBA for ever.


I can’t take full credit for this, as I was inspired by some remarks on twitter quite a while ago (“Yea, though I walk through the valley…”) A little detective work showed it probably originated on the SQL Server Central Forum.

Nov 222011

As a follow-up to my previous post about the steps you may have to go through to attend training if your employer can’t or won’t offer assistance in the form of either money or time off, I have a story of my own to tell. I was unhappy at my previous place of work for several reasons, a few of which I’ve blogged about already and a few more I’m sure will come in the future.

Back in March it was announced that SQLskills was coming to Chicago in May for one of their immersion events, and I immediately knew I had to find a way to get there for several reasons. First, they hadn’t ever held such an event in Chicago before, at least that I had known of. Second, it was actually in the suburb of Oak Brook, which is no more than 20 minutes from my house, meaning I could save significant money by not having to pay for hotel accommodations. I realize there are some good reasons others have blogged about for staying at the hotel for such an event as opposed to commuting home every night, but for me the money savings was key. Finally (and perhaps most importantly), I felt I was ready for such training. Had this occurred a year earlier I don’t think I would have been prepared, but at this point I believed I had the solid understanding of concepts that would allow me to benefit from this level of instruction.

LemonadeWhen I took my previous job, I was told they had a budget for training and professional development and that I would be able to make use of it if an appropriate event came up. Had I been told otherwise, I never would have accepted the position to begin with. Feeling the immersion event was a great opportunity, I brought it up to my manager. He said he would think about it and get back to me. A month passed and I heard nothing, so I asked again. At that point he told me no, he wouldn’t be able to help me pay for it, because he didn’t feel I needed any training. You see, I had this habit of getting my work done correctly, on time, and never really had to ask anyone to help me in the process. To me that would mean that I’m a good worker, but apparently to him it meant that I was as good as he needed me to be and thus didn’t need any form of training. I guess to be worthy of training, I would need to screw things up or asked to have my hand held while doing my job. What an excellent work ethic to instill in your employees!

After a few more attempts of explaining that such opportunities don’t come around often, I got a final answer of no, they would not pay for it. Ok fine, I thought. I told them I would pay for it myself and asked if I could have the time off to attend without taking away from my vacation. I got a firm “no” for that as well. I was also told that taking the time off without pay wasn’t an option, so the only way I was getting the time off to attend the class would be if I requested the vacation time and they decided to approve it. Realizing again that the chance for such training wouldn’t come around again for a while, I decided to go ahead and take the week off to attend. I felt the benefits of the immersion event would far outweigh the cost in terms of both money and vacation time. Besides, I might not always have the money to front for such experiences.

I went to the class and it was amazing. Everything I had hoped it would be. I’ve already blogged about my experience, so if you’re interested and haven’t read about it already, feel free to check out that post.

When I got back to work after my week of vacation, recharged from my week of being immersed, the funniest thing happened. My manager had the gall to ask me if I could copy my notes and materials from the class so the other DBAs could benefit. My answer literally was “not just no, HELL NO!”. I attended that class on my own dime and my own time. Work had no interest in it, and besides I was on vacation. Whether I spent the week doing consulting work, lying on a beach, or being an axe murderer it really shouldn’t matter to them. He wasn’t pleased, but I had another ace up my sleeve:

The benefits of our SQL Server community never cease to amaze me. It’s an amazing way to meet other people, and those people will put you in touch with others, some of which might be looking to hire a new DBA. A few weeks prior to the immersion event I got an email from Brent Ozar (blog | @BrentO) saying that one of his clients was looking to hire a new DBA and he thought I would be a great fit. He put me in touch with them, I interviewed, and I was offered the job while I was away at training for the week. Upon my return I was planning on giving my two weeks’ notice anyway, but it was an extra convenient time to do so when I was asked to hand over my notes. It made the moment all the sweeter.

So what’s the lesson from all of this? I like to think that “if there’s a will, there’s a way.” I was able to achieve my goal and learn a ton even though it cost me money and vacation time. Perhaps the bigger lesson here is that nothing has to be permanent if you don’t want it to be. Never be afraid to ping your network when you’re looking for work, even if you’re just passively exploring your options. You never know what might pop up.

A very Happy Thanksgiving to all my readers who celebrate it! While it’s an American holiday, I like to think that the concept of gathering with family and loved ones to share a meal and reflect on our many blessings can be appreciated in any corner of the world. All the best to you and yours!

Nov 152011

In honor of today being the last day to get the special preview rate for the 2012 PASS Summit, I thought I’d offer some tips on negotiating with your boss for money to attend such a conference or training event. For more info about registration, click here.

MoneyKeeping up to date in the technology world is a journey, not a destination. I’m at peace with the fact that I’ll never know everything about SQL Server, but that doesn’t make me want to stop learning more. If you’re not putting in the extra time to keep your skills and knowledge up to date, rest assured that someone else is.

Because of this, I’ve made sure to bring up questions about professional development in my last two job searches. Employers should value employees who strive to progress in their field, and lack of willingness to allow me to do this is a total deal-breaker for me in a job search. Of course it’s very easy to lie about it as well – I could make myself sound totally ambitious and energetic just to get my foot in the door somewhere, knowing that if I do a decent job they probably won’t get rid of me for lack of seeking out training. Similarly it’s very easy for an employer to mislead an interviewee and tell them they have a budget for employee education and support such initiatives. It’s also quite possible that an employer had a training budget when you were hired and those funds have since dried up or were reduced due to budget cuts or the like. Unfortunately things like this can happen from time to time. The question, then, is what to do about it.

So you’ve pitched a class or conference to your boss and they’ve come back to you saying that they’d like to send you because it seems like a great opportunity, but there just isn’t room in the budget. Many will just give up at this point, but we’re more persistent than that, so some bargaining is now in order.

Offer to pay part

The first step is to ask if they can cover only part of the expense. Offer to pay for the travel and hotel expenses yourself if the company can cover your registration fee. Not only do you get to attend the training you wanted, but you also show your employer that you’re really serious about it and willing to contribute to the expense. Be sure to stress that you’ll be happy to share the knowledge you gain with the rest of the team upon your return. Another great point to bring up is that the company spends big money on SQL Server licenses, and a few thousand dollars extra to ensure you are well-trained to maintain such software is paltry by comparison.

Pay for it all in exchange for time

BankIf the above doesn’t work either because your boss won’t budge or perhaps there’s really no training budget at all, the next step is to offer to cover the costs yourself, provided you are given the time off to attend said training outside of your vacation time. Both sides benefit from this – you get the training you want, and your employer gets the benefit of a more educated employee at no real expense to them. Even though you’re paying, it’s still a win-win in my book.

This most common rebuttal to this will probably be along the lines of “we really can’t have you out of the office like that”. Assure them you’ll be available by cel phone and email, just like when you’re at home on evenings and weekends. Also mention that if there’s really an emergency, you’ll have your laptop with you and will be available to login remotely and work with the rest of the team back at the office to resolve any issues. Point out that this is even a better deal for them than when you take vacation time, because you’ll be able to guarantee your availability this time around.

Go completely on your own

Finally, if your employer can’t stomach the cost of having you out of the office for free to attend training that will make you better at your job, my first thought is that you should think long and hard about if you want to remain working at that company. Switching jobs is a pain, but I’d say chances are quite good you can do better somewhere else. At this point, if you’re really serious about attending and you have PTO to burn, take the time off and go. You’ll be glad you did.

Nov 082011

T-SQL Tuesday LogoThis month bring us the 24th edition of T-SQL Tuesday (24 already? wow….). This time around our topic comes from Brad Schulz (blog) and has to do with stored procedures and functions. Brad’s asking us to write whatever we’d like about either of them.

While from the bird’s-eye view both functions (the table-valued variety) and stored procedures appear as packages of code that can be encapsulated, they’re completely different and much thought should be given before making the decision to deploy code as either a stored procedure or function. While they are totally different animals, I feel there’s a few basic pros and cons of each that should be known:

Stored Procedures


  • The concept of a stored procedure is pretty well-known and similar across most platforms (you can find stored procedures in Oracle, MySQL, PostgreSQL, etc.)
  • Can perform pretty much any task, queries, administrative, etc.


  • It’s a huge pain to incorporate the result sets from a stored procedure into another query – Table-Valued Functions are much better for this purpose.

Table-Valued Functions


  • Can be used in a query just like any other table or view, and are very handy for this purpose.
  • Can be thought of as a view that accepts parameters. An excellent choice if you want to expose views to people and shelter them from having to write additional SQL such as WHERE clauses.


  • Functions can’t make changes to the database state, such as changing the recovery model. You can’t even create a function that does this – attempting to do so will return error 443.
  • You must list out ALL parameters, even those you just want to use the default value for (and assign them a value of DEFAULT). This behavior is different from a stored procedure, where you can simply omit the parameters that you wish to use a default value for.

I should add that this listing is only the tip of the iceberg. There are many more differences between stored procedures and table-valued functions, and other types of functions (eg. Scalar) exist as well. This is just a quick set of things I keep in my head for general design considerations.

Nov 072011

This is the second time I’ve participated in the “Meme Monday” blog events that have been brought to us by Tom LaRock (blog | @SQLRockstar). The topic is on what “SQL Family” means to us. A few things popped into my head as soon as I read it, and I’m happy to share them:

SQLFamily photoFirst and foremost SQLFamily means there’s people you can count on for help, no matter what time it is. Twitter definitely makes this possible, because there’s always people in our family awake in some part of the world, online and chattering about something. The #sqlhelp hash tag makes it even easier to accomplish this.

Another thing that’s made me feel special about our SQLFamily since the very beginning was the sense of equality between members. There’s a very wide range of skills between all of us, from those who are just getting started in the database world all the way up to the experts that write books, documentation, and exams for everyone. I’m very proud to say that I’ve never witnessed any form of elitist behavior, and it’s really nice to know that those at the top of the food chain haven’t forgotten that they started off at the bottom at one point too.

Finally, like any other type of family, there’s plenty of encouragement going around in our SQLFamily. It’s an incredibly supportive and accepting environment. When someone does something awesome like pass a certification exam, give a presentation or publish an excellent blog post, there’s always plenty of hi-fives and love to go around. To me it’s a lot like the “cool kids club” in grade school, except membership is really and truly open to everyone. That’s why I love it so much.