How to create a copy of data in MS SQL Server

Backup is a data backup / database. Backing up databases in MS SQL Server is very important to protect data before losing databases. There are 3 main backup types in MS SQL Server: Full / Database, Differential / Incremental, Transactional Log / Log.

Here are 2 ways to create a backup of databases in MS SQL Server.

Method 1: Use T-SQL

Full / Database

 Backup database to disk = '' 

Differential / Incremental

 Backup database to 
disk = '' with differential

Transactional Log / Log

 Backup log to disk = '' 

For example: The following command is used to backup the entire database (Full / Database) named TestDB to the address D: with the name of the backup copy is TestDB_Full.bak

 Backup database TestDB to disk = 'D:TestDB_Full.bak' 

The following command is used to back up changes since the last backup on the database (Differential / Incremental) named TestDB to address D: with the name of the backup copy is TestDB_Full.bak

 Backup database TestDB to disk = 'D:TestDB_diff.bak' with differential 

The following command is used to back up the order of all transactions since the last transaction Log backup on the database (Transaction Log / Log) named TestDB to the address D: with the name of the backup copy is TestDB_Full.bak

 Backup log TestDB to disk = 'D:TestDB_log.trn' 

Method 2: Use SQL Server Management Studio (SSMS)

Step 1 : Connect to the database installation named TESTINSTANCE and open the database directory as shown below.

How to create a copy of data in MS SQL Server Picture 1
Open the database directory

Step 2: Right-click on the Testdb database and select Backup backup task , then the screen below will appear.

How to create a copy of data in MS SQL Server Picture 2
Information to select the backup form for the database

Step 3: Select the type of database backup and choose the correct path for the copy to be saved. Select Options in the upper left corner of the screen, then the following dialog box will appear.

How to create a copy of data in MS SQL Server Picture 3
Select to backup another database

Step 4: Select OK to create a backup for TestDB as shown in the image below.

How to create a copy of data in MS SQL Server Picture 4
Create a successful backup

Check in the selected directory path, you will see the backup file.

How to create a copy of data in MS SQL Server Picture 5
The backup file of the TestDB database has just been created

Previous article: How to delete the database in MS SQL Server

Next lesson: How to recover the database in MS SQL Server

5 ★ | 2 Vote

May be interested

  • How to copy data from computer to BlueStacks?How to copy data from computer to BlueStacks?
    in the previous article, tipsmake.com showed you how to simulate android to play games on your computer using bluestack software. today, we will share with you how to copy data from computers to bluestacks. please consult
  • Tools to speed up data copying on Windows for freeTools to speed up data copying on Windows for free
    copy speed to copy data using the default windows program is not really good. more efficient applications such as: fast copy, extreme copy or teracopy.
  • Deploy Data Protection Manager 2007 (Part 1)Deploy Data Protection Manager 2007 (Part 1)
    data protection manager (dpm) is designed to protect microsoft applications and servers in an active directory environment. dpm uses continuous data protection. dpm server protects servers by creating and maintaining a copy of the information stored at c
  • Deploy Data Protection Manager 2007 (Part 4)Deploy Data Protection Manager 2007 (Part 4)
    data protection manager (dpm) is designed to protect microsoft applications and servers in an active directory environment. dpm uses continuous data protection. dpm server protects servers by creating and maintaining a copy of the information stored at c
  • Encryption in SQL Server 2005Encryption in SQL Server 2005
    encryption is an important method of data security. sensitive data such as cmt numbers, credit card numbers, passwords ... need to be protected against numerous current threats. in sql server 2000 you can create your own functions or use external dlls to encrypt data. in sql server 2005, functions and methods
  • Data types in SQL ServerData types in SQL Server
    below are the data types (data types) in sql server, including character strings, numbers and times / dates.
  • Instructions for copying or moving Worksheet in Excel 2013Instructions for copying or moving Worksheet in Excel 2013
    the move or copy command allows you to easily move or copy the entire worksheet, including all data and formats in excel, in case you create a new sheet or a new book that wants to copy data from excel. old to.
  • 5 ways to copy data from Raspberry Pi to PC5 ways to copy data from Raspberry Pi to PC
    whatever purpose you use raspberry pi for, at some point, you will want an easy way to get data out of pi's sd card and insert it into your pc's hard drive.
  • how to fix error cannot copy data in Excel fileshow to fix error cannot copy data in Excel files
    in the process of using the computer, there will be times when we encounter an error that we cannot copy data in excel. the cause may be that the computer has a virus, the clipboard is not working, and therefore the copy command (ctrl + c) and the paste command (ctrl + v) are not working.
  • SELECT INTO command in SQL ServerSELECT INTO command in SQL Server
    the article guides using select into command in sql server with syntax and examples.