SQL SERVER – Sample Script for Compressed and Uncompressed Backup


 

During Comprehensive Database Performance Health Check, I was recently asked if I have a handy script that can help us take compressed backup and uncompressed backup. Well, of course, I have and here it is. The scripts are very simple.

Compressed Backup BACKUP DATABASE [StackOverflow2010] TO DISK = N’D:backupCompressed-Backup.bak’ WITH COMPRESSION, STATS = 10 GO Not compressed Backup BACKUP DATABASE [StackOverflow2010] TO DISK = N’D:backupUncompressed-Backup.bak’ WITH NO_COMPRESSION, STATS = 10 GO

When you want to restore either of the back-ups, there is no special command for it. The script for the restore operation is the same for both of