This question already has an answer here:
I don't believe this is possible but wanted to check.
I've got a bi-weekly job running to restore the full backup to a test environment so the devs have something fresh to destroy without damaging the actual environment. The problem is cropping up that the test environment has less space than the production environment (it's stuck on one drive instead of a number of drives).
When copied across the database is now using over 95% of the hard disk allocation that it has. Is there any way along side the Restore Database WITH MOVE to resize those files? There is free space in a number of the files that could be shrunk and the file size is never going to change from the backup as it doesn't have data getting thrown at it so technically they can get cut all the way back to their data size.
The alternative, which I don't really want to do, is shrink the files on the production environment that have a bit too much space available at the minute.
Any tips or ideas of anything to do? Adding a new hard disk unfortunately isn't an option as the drive bay attached is full.