mssqltips logo

SQL Server RESTORE LABELONLY



By:

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

T-SQL

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.

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

Last Update: 3/17/2009




More SQL Server Solutions











Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name
*Email
Email me updates

Signup for our newsletter

I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.






download





get free sql tips

I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



Learn more about SQL Server tools