Loading lesson path
statement is used in SQL Server to create a full backup of an existing SQL database.
databasename TO DISK = ' filepath
';The following SQL creates a full backup of the existing database "testDB" to the D drive:
TO DISK = 'D:\backups\testDB.bak';
Always place the backup database in a different drive than the original database! If you get a disk crash, you will not lose your backup file along with the database.
A differential backup only captures the data that has changed since the last full backup. A differential backup requires at least one prior full backup!
databasename TO DISK = ' filepath '
DIFFERENTIAL;The following SQL creates a differential backup of the database "testDB":
TO DISK = 'D:\backups\testDB.bak'
DIFFERENTIAL;A differential backup reduces the backup time (since only the changes are backed up).