How can we help you today? How can we help you today?

RESTORE LABELONLY FROM DISK ?

I need to execute a RESTORE LABELONLY FROM DISK command against a SQL Backup (sqb) full backup file.

I'm using the following syntax:
exec master..sqlbackup '-sql "RESTORE LabelOnly FROM DISK =''<pathname>''"'

But I get an error:
Syntax error: 'LabelOnly' after 'RESTORE'
and
name value
exitcode 850
sqlerrorcode 0

Is this command not supported?
pf_rodier
0

Comments

3 comments

  • petey
    No, RESTORE LABELONLY is not supported.

    Which details are you interested in looking at from the RESTORE LABELONLY output?
    petey
    0
  • pf_rodier
    We we're using it in a script that generates restores scripts automatically, to refresh our support and test environments from a scheduled job.

    I ultimately modified the script and it is does not need this command anymore.
    pf_rodier
    0
  • Virul
    Task: Redgate created bakup in split file. So i have 4 sqb files.
    We need to create dynamic restore script and restore db on SQL instance.

    I want to figure out how many sqb files backup has?, in this case it should be 4.

    We are passing first sql file as parameter
    I am using below command
    EXEC MASTER..SQLBACKUP '-SQL "RESTORE LABELONLY FROM DISK = ''D:\backups\bfile_1.sqb''

    It seems labelonly does not work

    I am getting below result. 
    Syntax error: 'LABELONLY' after 'RESTORE'
    exitcode 850
    sqlerrorcode 0

    Any help?
    Virul
    0

Add comment

Please sign in to leave a comment.