Notes on SQL

Random articles from a puzzled DBA

Overview

Several of the instances in an Availability Group (AG) that I look after, have some of the Temp DB data files stored on the C: drive. This is generally not a good idea – certainly when you have another drive allocated for the TempDB. All TempDB files need to be in the correct location and moving them isn’t as difficult as some people would appear to believe.

Continue reading

Overview

One thing everybody should realise, is that SQL Server is a huge product – you’ll never learn all of it. Therefore, you shouldn’t feel embarrassed when you learn something that others around you might take for granted.


Reviewing somebody’s code, I came across a segment of the procedure that made no sense to me. As I knew the person who wrote the code is not generally prone to basic errors, I assumed the issue was with my understanding. Surely enough, I have discovered something that I found quite entertaining – you can update a table via the Common Table Expression (CTE) that is linked to it.

Continue reading