Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using RESTORE HEADERONLY and checking the BackupType column to tell differential and full backups apart, but a little stumped on how to restrict the data that is being returned from the RESTORE HEADERONLY command.

How can you restrict the RESTORE HEADERONLY return set to just the BackupType column return info?

I guess make a stored procedure...? Any suggestions?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can't. You would need to create a table and do an

INSERT INTO #MyTable
RESTORE HEADERONLY ...

Then select only the columns that you want from the table.

share|improve this answer
    
thanks! all interested in the functionality mrdenny suggests should see: karaszi.com/SQLServer/util_restore_all_in_file.asp –  asteroid Jul 11 '11 at 14:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.