Category: sql server

Restore a SQL Server Backup (WITH MOVE)

This is a basic skill can get overlooked, so let’s talk about a common DBA task: backing a database up and restoring it to another server. First let’s dispel a couple of common misconceptions: You cannot restore a backup from a later version of SQL Server, to an earlier version. For example, a 2016 backup will […]

CROSS JOIN for fun

My son, who wishes to be known as “Pigeon” for the duration of this blog, was mixing the names of Hogwarts houses over a game of chess* with his brother: “ONE MILLION POINTS TO GRYFFINPUFF!” So I said, “Hey guys, I’m going to do a nerdy thing with my database skillz and then show you, okay? […]

RegEx in SSMS: A gift for quick code

I had yet another example of how beautiful Regular Expressions can be in SQL coding today, and so I thought I’d share. What I HAD was a set of DELETE statements that might or might not have been executed recently: DELETE FROM dbo.Table1 WHERE val = 1 DELETE FROM dbo.Table2 WHERE val = 1 DELETE […]