title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
View backup contents (file or tape) |
This article shows you how to view the content of a backup tape or file in SQL Server by using SQL Server Management Studio or Transact-SQL. |
MashaMSFT |
mathoma |
12/17/2019 |
sql |
backup-restore |
conceptual |
|
[!INCLUDE SQL Server]
This topic describes how to view the content of a backup tape or file in [!INCLUDEssnoversion] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql].
Note
Support for tape backup devices will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
In This Topic
-
Before you begin:
-
To view the content of a backup tape or file, using:
For information about security, see RESTORE HEADERONLY (Transact-SQL).
In [!INCLUDEsql2008-md] and later versions, obtaining information about a backup set or backup device requires CREATE DATABASE permission. For more information, see GRANT Database Permissions (Transact-SQL).
-
After connecting to the appropriate instance of the [!INCLUDEmsCoName] [!INCLUDEssDEnoversion], in Object Explorer, click the server name to expand the server tree.
-
Expand Databases, and, depending on the database, either select a user database or expand System Databases and select a system database.
-
Right-click the database you want to backup, point to Tasks, and then click Back Up. The Back Up Database dialog box appears.
-
In the Destination section of the General page, click either Disk or Tape. In the Back up to list box, look for the disk file or tape you want.
If the disk file or tape is not displayed in the list-box, click Add. Select a file name or tape drive. To add it to the Back up to list-box, click OK.
-
In the Back up to list-box, select the path of the disk or tape drive you want to view, and click Contents. This opens the Device Contents dialog box.
-
The right-hand pane displays information about the media set and backup sets on the selected tape or file.
-
Connect to the [!INCLUDEssDE].
-
From the Standard bar, click New Query.
-
Use the RESTORE HEADERONLY statement. This example returns information about the file named
AdventureWorks2022-FullBackup.bak
.
USE AdventureWorks2022;
RESTORE HEADERONLY
FROM DISK = N'C:\AdventureWorks2022-FullBackup.bak' ;
GO
backupfilegroup (Transact-SQL)
backupfile (Transact-SQL)
backupset (Transact-SQL)
backupmediaset (Transact-SQL)
backupmediafamily (Transact-SQL)
Backup Devices (SQL Server)
Define a Logical Backup Device for a Disk File (SQL Server)
Define a Logical Backup Device for a Tape Drive (SQL Server)