Returns a result set containing information about the backup media identified by the given backup device.
RESTORE LABELONLY
FROM <backup_device>
[WITH {NOUNLOAD | UNLOAD}]
<backup_device> ::=
{
{'backup_device_name' | @backup_device_name_var}
| {DISK | TAPE | PIPE} =
{'temp_backup_device' | @temp_backup_device_var}
}
Allows backups to be restored from the named disk, tape, or pipe device. The device types of disk and tape should be specified with the actual name (for example, complete path and file name) of the device: DISK = ‘C:\Mssql7\Backup\Mybackup.dat’ or TAPE = \\.\TAPE0. A device type of pipe should specify the name of the named pipe that is used by the client application. If specified as a variable (@temp_backup_device_var), the device name can be specified either as a string constant (@temp_backup_device_var = 'temp_backup_device') or as a variable of character string data type, except for the ntext or text data types.
Pipe devices have been added to allow third-party vendors a flexible way to connect their own software. The pipe device is not used for typical Transact-SQL use.
If you are using either a network server with a UNC name or a redirected drive letter, specify a device type of disk.
RESTORE permissions default to members of the sysadmin fixed server role and the db_owner fixed database role, and are not transferable.
Executing RESTORE LABELONLY is a quick way to find out what the backup media contains. Because RESTORE LABELONLY reads only the media header, this statement finishes quickly even when using high-capacity tape devices. The result set from RESTORE LABELONLY consists of a single row with this information.
Column name | Data type | Description |
---|---|---|
MediaName | nvarchar(128) | Name of the media. |
MediaSetId | uniqueidentifier | Unique identification number of the media set. This column is NULL if there is only one media family in the media set. |
FamilyCount | int | Number of media families in the media set. |
FamilySequenceNumber | int | Sequence number of this family. |
MediaFamilyId | uniqueidentifier | Unique identification number for the media family. |
MediaSequenceNumber | int | Sequence number of this media in the media family. |
MediaLabelPresent | tinyint | Whether the media description contains: 1 = Microsoft Tape Format media label 0 = Media description |
MediaDescription | nvarchar(255) | Media description, in free-form text, or the Microsoft Tape Format media label. |
SoftwareName | nvarchar(128) | Name of the backup software that wrote the label. |
SoftwareVendorId | int | Unique vendor identification number of the software vendor that wrote the backup. |
MediaDate | datetime | Date and time the label was written. |
Backing Up and Restoring Databases | RESTORE FILELISTONLY |
BACKUP | RESTORE VERIFYONLY |
Data Types | Understanding Media Sets and Families |
RESTORE | Using Identifiers |