Database snapshots for everyone!

Database snapshots have been available in SQL Server Enterprise edition in the last several versions. But if you’re lucky enough to have 2016 at work, go on and upgrade to SP1….you get extra-lucky special database snapshots in any version!

(Be sure to read the footnote for “Database snapshots” in that link.)

What are database snapshots for?

Oh what’s that? You don’t use snapshots? Well let’s see a couple of good use cases for them:

  • Take a database snapshot before an upgrade, data load, or major change. It’s WAY faster than a backup, and you can roll back the changes if you need to, almost instantly.
  • Customize integrity checks. When you run DBCC CheckDB or DBCC CheckTable, behind the scenes SQL Server creates a snapshot of the database to run the operation against. You can also choose to create a custom snapshot…among other reasons, so you can specify where the snapshot files are placed. This is especially useful for shops running tight on disk space.

Speaking of integrity checks and snapshots, Minion CheckDB is slated to come out on  this coming February 1.  Be on the lookout…it’s going to blow your mind.

Happy days,
Jen

Why won’t my SP work THIS time?

Quick test. Why won’t this return the string “Hi”?

CREATE PROC dbo.Testing @Val VARCHAR
AS
 IF @Val = 'One'
 SELECT 'Hi' AS msg;
GO
EXEC dbo.Testing @Val = 'One';

Try it yourself, and answer in the comments. I’ll update this (in comments) in a week or so with the answer, if no one’s gotten it.

And yes, I did this exact thing. You’re never too old to do something like this.

December: A two-line play.

“Wow! A family, a marathon, and two businesses! So how do you keep up with it all?” asked Twitter.

“Work-life balance,” she replied, glancing furtively at her sparsely populated blog.

Fin

 

(P.S. The latest blog on MinionWare.net, at least, is What Really Causes Performance Problems?)

 

Real news, real tech.