• Skip to main content
  • Skip to primary sidebar

DBA Diaries

Thoughts and experiences of a DBA working with SQL Server and MySQL

sql

Using SQL COALESCE to Find the First Non-NULL Value

May 10, 2017 by Andy Hayes 1 Comment

SQL COALESCE example

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 table from different sources and the consistency of data found in … [Read more...] about Using SQL COALESCE to Find the First Non-NULL Value

Data Management – Finding, Removing Duplicate Rows Using SQL and Some Prevention Tips

July 4, 2015 by Andy Hayes 2 Comments

find and remove duplicate data

Duplicate data is a common problem and in my experience comes in two main flavours; exact duplicate data and similar data. Exact duplicate data is when a data source contains the same values across all fields in the record. Similar data is when some of the fields match and to the naked eye can be classed as duplicate data but in fact it isn't - it's similar data and therefore … [Read more...] about Data Management – Finding, Removing Duplicate Rows Using SQL and Some Prevention Tips

T-SQL – Derived Tables Demonstrated and Explained

October 18, 2014 by Andy Hayes Leave a Comment

T-SQL is a very powerful language when dealing with sets and in this post, I am going to be demonstrating how to use derived tables. Derived tables are not the same as a temporary or physical tables where the fields and data types are declared. Nor are they subqueries. Instead, as the name implies, the table is derived from an existing table. I liken them to views but a view … [Read more...] about T-SQL – Derived Tables Demonstrated and Explained

How to Determine SQL Server Version Number In Various Ways

September 1, 2012 by Andy Hayes 1 Comment

sql server version number

It's important to be able to determine SQL Server version number. DBA's need to know what SQL Server version numbers they are supporting so that during patching windows, they can source and apply the correct patches or service packs. This information is useful as a reference to what issues may be contained in a certain build that could affect production. The DBA can quickly … [Read more...] about How to Determine SQL Server Version Number In Various Ways

Primary Sidebar

Categories

  • All Articles (82)
  • Career Development (8)
  • MySQL Administration (18)
  • MySQL Performance (2)
  • SQL Server Administration (24)
  • SQL Server News (3)
  • SQL Server Performance (14)
  • SQL Server Security (3)
  • SQL Tips and Tricks (19)

Top 10 Popular Posts

  • Using sp_change_users_login to fix SQL Server orphaned users
  • MySQL SHOW USERS? – How to List All MySQL Users and Privileges
  • How to shrink tempdb
  • How to Transfer Logins to Another SQL Server or Instance
  • How to Delete Millions of Rows using T-SQL with Reduced Impact
  • T-SQL – How to Select Top N Rows for Each Group Using ROW_NUMBER()
  • New T-SQL features in SQL Server 2012 – OFFSET and FETCH
  • How to Kill All MySQL Processes For a Specific User
  • Using exec sp_who2 to help with SQL Server troubleshooting
  • How to move tempdb

Recent Posts

  • How to Setup MySQL Master Master Replication
  • How To Use SQL to Convert a STRING to an INT
  • How to set up MySQL Replication Tutorial
  • How to Use SQL CASE for Conditional Logic in Your SQL Queries
  • Using ISNULL in SQL Server to Replace NULL Values

Search

Connect

  • Twitter
  • Facebook
  • Google+
  • RSS

About

  • Cookie Policy
  • Disclaimer
  • About
Copyright ©