Being Hectic With The Thrill

thrillIt happens every time anyone goes to an amusement park. The one park that sticks out to me is Disneyworld just because I was there on a recent family vacation. You know what I’m talking about – the crazy rides, the masses of people, the running to and fro. Vacation is supposed to be a relaxing time yet when you get into a park of any sort, at times, one can get caught up with the hustling and bustling – I know I’ve been there done that. While being on vacation a couple of things stuck out to me so much so that I think it does apply to the DBA life or any data professional for that matter. Below is a representation of what thoughts flowed through my head.

The Hectic

Have you ever noticed when you are in an amusement park people are rushing around as fast as they can to get to the next ride before the other person? While on vacation I was enamored to watch the bustling and running of people almost to the point of it being comical. I would watch the dad’s pushing the double wide strollers around basically at a run with the two kids in the stroller and one on his shoulders as they rushed to the next ride. The families that would run as soon as the park opens to get the famous “fast pass” to secure a time frame that they would not have to wait in line for hours on end.

How does that pertain to the DBA life? Easily enough the DBA life can at times be very hectic with several things going on all around them. It is just not one thing we focus on but a multitude of things that more times than not seem to go awry all at once. How do you react when those situations arise?

The Thrill

A long with the hectic aspect comes the thrill. You get to the that ride you’ve been waiting to ride and you’re next. You get on the ride and off you go down an 80 ft. drop or into that dark tunnel you never think  you’ll come out of. The unknown aspects and the thrill of the ride keeps you coming back for more.

As I am a SQL DBA, I think that same thought process can be applied. The thrill of solving that problem that has been unknown, working with other teams to find common ground to push forward on a project, getting that new index in place that takes a process running 45 minutes down to 10 seconds. It’s the thrill of the game that keeps you coming back for more.

The End Game

Have you taken inventory lately? When you get to work are you excited about your work? Do you always have that continuous desire to improve yourself as a data professional? Is that thrill still there like when you solved your first issue and you said, “I think I can do this!” If not recapture that fire you once had – enjoy what you do. There are a lot of people that would love to have the opportunities that we as data professionals have. Enjoy the time you have with it!

Giving Credit Where Credit Is Due


Have you ever stopped and looked at the SQL Community as a whole entity and all it has accomplished? Better yet, have you ever stopped and thought about a problem you’ve researched and found that someone else has already been experiencing it and has provided a solution? If you are doing any blogging or social media and present a solution in a manner that it is your own, is that right? Answer to the last question is no.

The Community

I have never been associated with a community like the SQL Community where everyone is eager to share their knowledge or advice in trying to achieve an answer or solution to an issue. More times than not solutions are provided on a blog similar to this one, a news letter, or twitter; it is very easy to take the research that was found and utilize it and pass it off as being completed by oneself – I’ve seen some do it and not think twice about it.

The Cost

The SQL Community has a plethora of great minds, some of which you will find over to the right in the DBA Blog section. Think about the countless work everyone puts in figuring solutions to issues and then sharing. If someone’s work is taken and used for their own gain time and time again eventually the well might dry up.

The Call to Give Credit Where Credit Is Due

The solution is basic and simple, if you use something that someone else has written give credit to them by referencing it. Below are some ways to do this:

  • Script – think of the countless scripts that have been provided over the years, some that come to my mind off hand are Brent Ozar’s sp_Blitz, Adam Machanic’s sp_whoisactive, Kendra Little’s sp_BlitzIndex, and Glenn Berry’s awesome diagnostic queries. It doesn’t have to be the ones I’ve mentioned here it can be scripts that someone has provided however big and small they maybe. The point is reference their work; because they are the ones who provided it.
  • Blog Information – A vast majority of my DBA colleagues have blogs they use daily, weekly, or monthly with a ton of information on them. If you are passing or using this information along just note where you got it from.
  • Email the Author – email the author and ask them if it is okay to use there work on a site for example if you reference their name. A couple reasons I mention this – 1.) it is a display of respect and 2.) it also shows the author that there is appreciation for their efforts in sharing their knowledge

The Awareness

Not everyone is perfect, I understand that, but over the course of the last few months I have seen many occurrences where situations could have been avoided and hard working data professionals have been bitten by their work being taken and utilized for someone else’s personal gain. Think about this question – we are data professionals in some form or fashion; where does utilizing someone else’s work without referencing it sound professional? Let’s keep our community strong and thriving.

Closing with the Thanks

A big thanks to all the community for the relentless time and effort along with the countless hours in making solutions for us who seek them for every day issues. If we make a mistake along the way because we are human may we own up to it, learn from it, and move on with integrity and character.

How’s Your Database Mail?

Database MailFrom time to time I field questions regarding Database Mail usage within SQL. Questions come from all over discussing how to identify what the job is doing or what the job has done. Sure, you can send some test mails through the nice GUI part, but that is not what this post is about. I enjoy T-SQL and looking inside SQL the old fashion way so to speak so I utilize some simple queries that a colleague of mine recommended for me.

Database Mail in and of itself is a useful tool; it allows for notifications of failed SQL jobs for instance. The messages in and of itself can contain a plethora of information that can assist one in troubleshooting a variety of issues. According to Microsoft they state Database Mail in this manner – “Database Mail is designed for reliability, scalability, security, and supportability.”

**NOTE** Database Mail is not active by default; it has to be configured and turned on. The below information assumes that Database Mail is already set up. For information on how to set up Database Mail you can go here

To give a brief overview the below script is broken out into 7 mini scripts; these scripts consist of checks against Database Mail along with the process of stopping and restarting database mail. Please note the disclaimer and hope this helps with some of the questions that I’ve received thus far regarding Database Mail.


Disclaimer: Do not execute code found on the internet without testing on your local or testing environment. Running any code in a production environment that you find on the internet is not an acceptable practice and this site is not responsible for any repercussions that may follow if you choose to do so.

Scripts below are numbered; the corresponding numbers will give you a description of what they are utilized for.

1. The status of the Database Mail. Possible values are Started and Stopped (msdn article on sysmail_help_status_sp)

2. Stops the database mail queue that holds outgoing message requests (msdn article on sysmail_stop_sp)

3. Starts the database mail queue that holds outgoing message requests (msdn article on sysmail_start_sp)

4. Shows all the mail items

5. Shows all the unsent mail items

6. Shows all the sent mail items

7. Shows all the failed mail items


USE msdb


/*1.*/ EXECUTE sysmail_help_status_sp

/*2.*/ EXECUTE sysmail_stop_sp

/*3.*/ EXECUTE sysmail_start_sp

/*4.*/ SELECT * FROM dbo.sysmail_mailitems (NOLOCK)

/*5.*/ SELECT * FROM dbo.sysmail_unsentitems (NOLOCK)

/*6.*/ SELECT * FROM dbo.sysmail_sentitems (NOLOCK)

/*7.*/ SELECT * FROM dbo.sysmail_faileditems (NOLOCK)