Skip to content

T-SQL Tuesday #123 – Favourite SQL Server life hack

Reading Time: 4 minutes
T-SQL Tuesday #123 - Favourite SQL Server life hack

My T-SQL contribution for this month is about my favourite SQL Server life hack. However, I will give some honourable mentions to others as well.

This month’s T-SQL Tuesday is hosted by Jess Pomfret. Jess invites us all to write about our favourite life hack.

You can read more about the invite in detail by clicking on the T-SQL Tuesday logo above.

For me, this is a tough call. Mostly because after being on this planet for a long time and working in IT for over half of it I have collected a fair few.

Plus, I don’t know about other people but mine seem to keep growing. For example, I now wear jackets with as many pockets in as possible when taking short flights to carry more items.

However, this is a T-SQL Tuesday post. So, I should do my favourite SQL Server related one. I will give honourable mentions to other life hacks outside of technology towards the end because sharing is caring.

After deep thought, here is my favourite SQL Server life hack.

Glenn Berry’s diagnostic scripts

It was a close call between this and Brent Ozar’s First Responder toolkit. However, I have used Glenn’s scripts for many years now.

I will quickly recap for those who are not fully aware of these scripts. For years now Glenn has provided a whole load of diagnostic scripts to check things in SQL Server.

You can use these scripts to find out a lot of things. Like the configuration of your SQL Server and potentially missing indexes. In fact, I have been a big fan of Glenn’s index advantage script ever since it was in the original MVP Deep Dives book many years ago.

Personally, I have used this script a lot to identify potentially missing indexes. It has made myself and clients very happy because the number times I have used it to identify indexing problems.

A lot of common performance issues are down to indexes, so this helps a lot. In addition, Glenn has scripts that can help you identify problem queries.

On occasion, it has also helped me identify issues with memory allocation (NUMA) as well.

Until recently, Glenn was working for SQLSkills and kept the scripts updated on their site. However, I have noticed that he now has an updated version of the scripts on his own site here.

Honourable mentions

I will give some honourable mentions here. For starters, I also use Brent Ozar’s First Responder toolkit to help with issues, and actively promote others to use it.

In addition, I recommend using Ola Hallengren’s index maintenance solution instead of writing your own.

Another SQL Server life hack is to use PowerShell modules like dbatools as much as possible. Sure, writing your own PowerShell can be fun, but for the more complicated stuff this will save you a lot of time.

In fact, you can use dbatools commands with all the other free tools I have mentioned previously and more. Which by itself shows you just how useful this module can be when working with SQL Server.

Like the other tools mentioned above, dbatools is written by community members for us to all use for free. I have a lot of respect for these people who provide things for the community to use for free.

You can find the links to these and other free tools in a post I did about free SQL Server tools. Which I recommend reading if you want to work with SQL Server more efficiently. You can read it in detail here.

My last honourable mention about SQL Server related life hacks is about Azure Data Studio.

Because if you want to quickly deploy Docker containers locally or Big Data Clusters into AKS there is a useful wizard that you can use in Azure Data Studio. Which is currently called ‘Deploy SQL Server’.

If you want to see it in action, you can watch in in a video I made last year here. For the demo scroll along to 22:40 into the video towards the end.

Notepad

Another lifehack some may find strange is to realise just how useful notepad actually is.

For example, if you have issues with copying and pasting between two different applications copy to notepad first and from there post to the other application.

In addition, you can use it alongside udl files as a quick way to create connection strings. I covered some of its uses in a previous post here.

Outside of technology

In reality, I have other lifehacks which are useful outside of technology as well. Just like the example I gave earlier about jackets with more pockets.

Another life hack which I have started doing again since working in the Netherlands is to commute more. Doing this allows me to have more time to work on the laptop instead of being stuck in traffic.

In fact, I use to do this for one company when I worked over in the UK. Mostly because it was an easy route. In addition, it meant that I did not have to drive home if I had worked long hours in the office for some reason.

It’s something that has worked really well for me and allows me to make the most of my day. Of course, the downside is the earlier starts.

Final word

Jess definitely picked an interesting topic for this month’s T-SQL Tuesday. I’m certainly looking forward to seeing all the other life hacks everybody shares.

Published inT-SQL Tuesday

One Comment

  1. Thanks for the kind words and the mention! I am glad you have found my scripts useful over the years.

Leave a Reply

Your email address will not be published. Required fields are marked *