Wednesday, June 17, 2009

MS SQL Database database backup

How to Create a Backup in SQL Server 2005?


This is the query for create a SQL server backup


BACKUP DATABASE [data_base_name] --Name of the database
TO DISK = N'F:\Backups\BackOffic.bak' --Location to save backup file
WITH NOFORMAT, --Specifies that the backup operation preserves the existing media header and backup sets on the media volumes used for this backup operation
INIT, --Specifies that all backup sets should be overwritten
NAME = N'Mye-Full Database Backup'
, --Name of the backup file
SKIP, --Disables the checking of backup set expiration and name that is usually performed by the BACKUP statement to prevent overwrites of backup sets.
NOREWIND, --Specifies that SQL Server will keep the tape open after the backup operation
NOUNLOAD, --Specifies that after the BACKUP operation the tape will remain loaded on the tape drive.
STATS = 10
--Displays a message each time another percentage completes (displays a message after each 10 percent is completed.)

0 comments: