Thursday, January 19, 2006

Mark Orlando

From Mark Orlando's blog - Backup /Restore SQL database:

Backup and Restore commands can only be executed from within the master database; this is accomplished by issuing the USE master command. The example below backs up the USRDB database to disk.

USE master
BACKUP DATABASE USRDB TO DISK = 'C:\Backup\Renee\DatabaseBackup\2005.07.20.1200.USRDB.Bak'

Restoring the database is almost no different than backing it up. The only additional to-do is to drop the database before you restore it. The example below restores the backup that was created from the above command.

USE master
RESTORE DATABASE USRDB FROM DISK = 'C:\Backup\Renee\DatabaseBackup\2005.07.20.1200.USRDB.Bak'

No comments: