Skip to content

Commit db8f46c

Browse files
authored
Merge pull request #27951 from markingmyname/health3
[Health] Update back and restore article with ssms
2 parents d3b83a7 + 018b410 commit db8f46c

2 files changed

Lines changed: 29 additions & 16 deletions

File tree

-82 Bytes
Loading

docs/relational-databases/backup-restore/quickstart-backup-restore-database.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
---
2-
title: "Quickstart: Back up & restore database"
2+
title: "Quickstart: Back up & restore database with SSMS"
33
titleSuffix: SQL Server
4-
description: In this article, learn how to create a new database, take a backup of the database, and restore the backup in SQL Server.
4+
description: In this article, learn how to create a new database, take a backup of the database, and restore the backup in SQL Server using SSMS
55
author: MashaMSFT
66
ms.author: mathoma
7-
ms.reviewer: randolphwest
8-
ms.date: 03/03/2022
7+
ms.reviewer: randolphwest, markingmyname
8+
ms.date: 08/04/2023
99
ms.service: sql
1010
ms.subservice: backup-restore
1111
ms.topic: conceptual
1212
---
13-
# Quickstart: Backup and restore a SQL Server database on-premises
13+
14+
# Quickstart: Backup and restore a SQL Server database with SSMS
1415

1516
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
1617

17-
In this quickstart, you'll create a new database, take a full backup of it, and then restore it.
18+
In this quickstart, you create a new database, take a full backup of it, and then restore it.
1819

1920
For a more detailed how-to, see [Create a full database backup](create-a-full-database-backup-sql-server.md) and [Restore a backup using SSMS](restore-a-database-backup-using-ssms.md).
2021

2122
## Prerequisites
2223

23-
To complete this quickstart, you'll need:
24+
To complete this quickstart, you need:
2425

2526
- [SQL Server](https://www.microsoft.com/sql-server/sql-server-downloads)
2627
- [SQL Server Management Studio (SSMS)](../../ssms/download-sql-server-management-studio-ssms.md)
@@ -41,9 +42,9 @@ To complete this quickstart, you'll need:
4142
USE [SQLTestDB];
4243
GO
4344
CREATE TABLE SQLTest (
44-
ID INT NOT NULL PRIMARY KEY,
45-
c1 VARCHAR(100) NOT NULL,
46-
dt1 DATETIME NOT NULL DEFAULT GETDATE()
45+
ID INT NOT NULL PRIMARY KEY,
46+
c1 VARCHAR(100) NOT NULL,
47+
dt1 DATETIME NOT NULL DEFAULT GETDATE()
4748
);
4849
GO
4950

@@ -60,37 +61,45 @@ To complete this quickstart, you'll need:
6061
SELECT * FROM SQLTest;
6162
GO
6263
```
63-
64+
6465
1. Refresh the **Databases** node in **Object Explorer** to see your new database.
6566

6667
## Take a backup
6768

6869
To take a backup of your database, follow these steps:
6970

71+
#### [SSMS](#tab/ssms)
72+
7073
1. Launch [SQL Server Management Studio (SSMS)](../../ssms/download-sql-server-management-studio-ssms.md) and connect to your SQL Server instance.
7174
1. Expand the **Databases** node in **Object Explorer**.
7275
1. Right-click the database, hover over **Tasks**, and select **Back up...**.
7376
1. Under **Destination**, confirm that the path for your backup is correct. If you need to change the path, select **Remove** to remove the existing path, and then **Add** to type in a new path. You can use the ellipses to navigate to a specific file.
7477
1. Select **OK** to take a backup of your database.
7578

76-
:::image type="content" source="media/quickstart-backup-restore-database/backup-db-ssms.png" alt-text="Take SQL backup":::
79+
:::image type="content" source="media/quickstart-backup-restore-database/backup-db-ssms.png" alt-text="Take SQL backup" lightbox="media/quickstart-backup-restore-database/backup-db-ssms.png":::
80+
81+
#### [T-SQL](#tab/t-sql)
7782

7883
Alternatively, you can run the following Transact-SQL command to back up your database. The path may be different on your computer:
7984

8085
```sql
8186
USE [master];
8287
GO
8388
BACKUP DATABASE [SQLTestDB]
84-
TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\SQLTestDB.bak'
89+
TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\SQLTestDB.bak'
8590
WITH NOFORMAT, NOINIT,
8691
NAME = N'SQLTestDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10;
8792
GO
8893
```
8994

95+
---
96+
9097
To read more about the different backup options, see [BACKUP (Transact-SQL)](../../t-sql/statements/backup-transact-sql.md).
9198

9299
## Restore a backup
93100

101+
#### [SSMS](#tab/ssms)
102+
94103
To restore your database, follow these steps:
95104

96105
1. Launch [SQL Server Management Studio (SSMS)](../../ssms/download-sql-server-management-studio-ssms.md) and connect to your SQL Server instance.
@@ -103,19 +112,23 @@ To restore your database, follow these steps:
103112
1. Select **OK** to close the **Select backup devices** dialog box.
104113
1. Select **OK** to restore the backup of your database.
105114

106-
:::image type="content" source="media/quickstart-backup-restore-database/restore-db-ssms2.png" alt-text="Restore the database":::
115+
:::image type="content" source="media/quickstart-backup-restore-database/restore-db-ssms2.png" alt-text="Restore the database" lightbox="media/quickstart-backup-restore-database/restore-db-ssms2.png":::
116+
117+
#### [T-SQL](#tab/t-sql)
107118

108119
Alternatively, you can run the following Transact-SQL script to restore your database. The path may be different on your computer:
109120

110121
```sql
111122
USE [master];
112123
GO
113-
RESTORE DATABASE [SQLTestDB]
124+
RESTORE DATABASE [SQLTestDB]
114125
FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Backup\SQLTestDB.bak' WITH FILE = 1, NOUNLOAD, STATS = 5;
115126
GO
116127
```
117128

118-
### Clean up resources
129+
---
130+
131+
## Clean up resources
119132

120133
Run the following Transact-SQL command to remove the database you created, along with its backup history in the `msdb` database:
121134

0 commit comments

Comments
 (0)