Notes on SQL

Random articles from a puzzled DBA

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