“How does RESTORE VERIFYONLY checks for space on destination drives when a drive isn’t specified as part of the statement?” was the question being asked this time.
And this was my answer to that one:
This is what SQL does:
Now, some curious findings about how this space availability feature works internally beyond what’s explained above and which are not thoroughly documented:
The tricky thing here is that RESTORE VERIFYONLY doesn’t let you override the name of the database as it comes in the backup set, so when the name of the database in the backupset matches that of a database in the instance in which you’re executing the RESTORE VERIFYONLY command, the calculations made by the space check logic might not coincide with what you were expecting. Keep in mind that SQL treats that backup as one that is expected to be restored on top of (replacing) an existing database with the exact same name, and you may be planning to restore it side by side, under a different database name.