SQL Server RESTORE LABELONLY

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'
GO

The result set would like the following.  As you can see there is a lot of great information that is returned when using LABELONLY.

ColumnNameValue
MediaNameNULL
MediaSetId8825ADE0-2C83-45BD-994C-7469A5DFF124
FamilyCount1
FamilySequenceNumber1
MediaFamilyId8A6648F8-0000-0000-0000-000000000000
MediaSequenceNumber1
MediaLabelPresent0
MediaDescriptionNULL
SoftwareNameMicrosoft SQL Server
SoftwareVendorId4608
MediaDate02:37.0
MirrorCount1

Leave a Reply

Your email address will not be published. Required fields are marked *