Database Backup in SQL Server

Backup database

The backup of a database is one of the most usefull tasks for database administrators.

Simple script for backup of a database to disk drives

I have Adventureworks2008 database in my SQL Server 2008.

database

Syntax for backup database
 

BACKUP DATABASE << Databasename >> TO DISK =<<Filename>>

Script for backup database

BACKUP DATABASE AdventureWorks2008 TO DISK='C:/AdventureWorks2008.BAK’

When we run the preceding query the database is backed up to the C drive with the AdventureWorks2008.BAK file name.

When we observe the C drive:

C drive

Backup the database with Object Explorer

Step 1

Right-click on the database. Go for tasks and click on "Back Up...".

Back up Option

Step 2
 
Backup the data base

Observe the following in the preceding screen shot:
  • Database: Adventureworks2008 is the name of the database that you backed up
     
  • Bakup type: backup type is the type of the backup (in the preceding screen shot the type of backup is Full)
     
  • Name: Name of the backup of the databse
     
  • Destiation: where the database backup is stored onto disk drives

Step 3: Click on the “OK” Button

After clicking on the OK button the databse is backed up onto the C drive with 100% success.

Databse is backup

Learn something new every day. We will learn 365 new this in the year: pinel Dave Sir

Up Next
    Ebook Download
    View all
    Learn
    View all