Andy Hayes is a DBA working with SQL Server since version 7.0. He has a wonderful wife and two beautiful children. He loves database technology, playing cricket, and blogging. He is passionate about sharing his experiences as a DBA and learning more to further his understanding and knowledge. You can follow me on Twitter, check out my Facebook page or follow me on

How to Use SQL CASE for Conditional Logic in Your SQL Queries

SQL CASE provides the author of the query with the ability to perform conditional logic in their SQL queries for SELECT, INSERT, UPDATE, DELETE. It is also possible to use it with SET, IN, HAVING, ORDER BY and WHERE. It comes in two formats: simple case search case Simple SQL CASE The simple CASE expression compares an expression to […]

Using ISNULL in SQL Server to Replace NULL Values

There are different ways to handle NULL’s and I wrote about one such way in my last post. In this post, we look at SQL ISNULL() and specifically at the SQL Server version. MySQL does have this function but it behaves a little differently as it returns a boolean value. Let’s look at the syntax ISNULL(check_expression, […]

Using SQL COALESCE to Find the First Non-NULL Value

You are looking to find a way to find the first non-null value from a list of fields. In this post, we look at SQL COALESCE – a wonderfully useful tool that helps to solve that problem. To help demonstrate this, we will talk about a hypothetical scenario where a number of customer leads have been added to a […]

How to Take a Backup of a Table in MySQL

Sometimes, there is a requirement to make a backup of a table in MySQL. For instance, there could be a data update planned, schema change needed or that it is necessary to work with a copy of a table, perhaps for some report. A possible approach to this is to run a full backup of […]

SQL Server 2016 New Features – Multiple TempDB Files Configured at Server Install

Configuring multiple tempdb files is not a new feature in SQL Server and has been a best practice for sometime to help ease and prevent tempdb contention which helps to increase the scalability of your SQL Server installation. Before SQL Server 2016, this was a task which needed to be carried out after the installation […]