Overview
The RESTORE LABELONLY option allows you to see the backup media information for the backup device. So if a backup device, such as a backup file, has multiple backups you will only get one record back that gives you information about the media set, such as the software that was used to create the backup, the date the media was created, etc…
Explanation
This information can only be returned using T-SQL there is not a way to get this information from SQL Server Management Studio.
The RESTORE LABELONLY option can be simply issued as follows for a backup that exists on disk.
Get labelonly information from a backup file
RESTORE LABELONLY FROM DISK = 'C:\AdventureWorks.BAK'
GOThe result set would like the following. As you can see there is a lot of great information that is returned when using LABELONLY.
| ColumnName | Value |
| MediaName | NULL |
| MediaSetId | 8825ADE0-2C83-45BD-994C-7469A5DFF124 |
| FamilyCount | 1 |
| FamilySequenceNumber | 1 |
| MediaFamilyId | 8A6648F8-0000-0000-0000-000000000000 |
| MediaSequenceNumber | 1 |
| MediaLabelPresent | 0 |
| MediaDescription | NULL |
| SoftwareName | Microsoft SQL Server |
| SoftwareVendorId | 4608 |
| MediaDate | 02:37.0 |
| MirrorCount | 1 |

Greg Robidoux has been working with databases for 35+ years with extensive hands on SQL Server experience from version 6.5 to 2025. He has authored over 250 technical articles and delivered several presentations online and at various conventions. Greg is also the President and founder of Edgewood Solutions, a technology services company delivering services and solutions for Microsoft SQL Server.


