How to Take Backup of Database in SQL Server

I will show you the following two ways of taking a backup of an existing database:

  1. Using a SQL Query
  2. Using the Object Explorer

Taking Backup Using Object Explorer

Let us try the first technique now. Open SQL Server and login using valid credentials.

Step 1

Right-click on the database. Go to Tasks -> Back Up.

Back Up

Step 2

Click on Add.

Add

Step 3

Provide a valid path and name to the database. Append “.bkp” to the file name. Click OK.

path and a name to the database

Step 4

Click OK.

process

Click OK

We get the backup of the database in the desired location.

get the backup

Taking Backup Using SQL Query

Execute the following SQL query:

    BACKUP DATABASE mydb TO DISK = 'E:\DatabaseBkp\DB2.bak'

Execute the query.

Execute the Query

We will get the following message. Let us now check the folder.

message

As we can see, we have a new database in the folder. This is how we take a backup of a SQL Server database.


Similar Articles