

For this month’s T-SQL Tuesday, Kevin Chant asked us to dream up our fantasy SQL Server feature. I’m sure people are gonna ask for flying cars and gene splicing, and that’s awesome. I’m excited to hear the kinds of things they dream up.

Me? I’ve got a really simple ask.

(When you’re talking to Microsoft people, you have to use “ask” as a noun.)

Today, if you have problems with a single file in your multi-file database, you can do an online file restore like this:

RESTORE DATABASE StackOverflow FILE='StackOverflow2013_1' FROM DISK=N'StackOverflow_Full_20190910.bak' WITH NORECOVERY; 1 2 3 4 RESTORE DATABASE StackOverflow FILE = 'StackOverflow2013_1' FROM DISK = N 'StackOverflow_Full_20190910.bak' WITH NORECOVERY ;

That one file is restored from backup, and you can update it by applying subsequent transaction logs, and then eventually bring it online. You can restore individual (or multiple) pages, too. But the thing is – I rarely need to restore a file, or specific pages.

So my ask is:

RESTORE DATABASE StackOverflow TABLE='Comments' FROM DISK=N'StackOverflow_Full_20190910.bak' WITH NORECOVERY; 1 2 3 4 RESTORE DATABASE StackOverflow TABLE = 'Comments' FROM DISK = N 'StackOverflow_Full_20190910.bak' WITH NORECOVERY ;

I just need a single object, like a table someone dropped, or a stored procedure from a mucked-up deployment that somebody didn’t really save in source control the way they were supposed to. I know, there are gonna be foreign key issues, and I’m fine with the keys being marked as untrusted at that point.

Like it too? Vote for Gonzalo Bissio’s feature request.