Returns a result set with a list of the database and log files contained in the backup set.
RESTORE FILELISTONLY
FROM <backup_device>
[WITH
[FILE = file_number]
[[, ] {NOUNLOAD | UNLOAD}]
]
<backup_device> ::=
{
{'backup_device_name' | @backup_device_namevar}
| {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.
A client can use RESTORE FILELISTONLY to obtain a list of the files contained in a backup set. This information is returned as a result set containing one row for each file.
Column name | Data type | Description |
---|---|---|
LogicalName | nvarchar(128) | Logical name of the file |
PhysicalName | nvarchar(260) | Physical or operating-system name of the file |
Type | char(1) | Data file (D) or a log file (L) |
FileGroupName | nvarchar(128) | Name of the filegroup that contains the file |
Size | numeric(20,0) | Current size in bytes |
MaxSize | numeric(20,0) | Maximum allowed size in bytes |
Backing Up and Restoring Databases | RESTORE HEADERONLY |
BACKUP | RESTORE LABELONLY |
Data Types | RESTORE VERIFYONLY |
Using Identifiers | Understanding Media Sets and Families |
RESTORE |