Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read the meta data out of SQL Server backup files directly?

Generally to get the meta data from SQL Server backup files, we need to use TSQL commands like restore headeronly or restore filelistonly. However, there are some third party tools can read this information directly from the backup files, like this one http://www.yohz.com/sqlbakreader_details.htm. Since this tool don't have a command line version, which makes it less useful. I want to know whether there are some ways that I can read this data directly.

Thanks.

like image 605
Just a learner Avatar asked Jul 22 '13 16:07

Just a learner


1 Answers

The .bak file is a Microsoft Tape Format file. Here's a PDF that contains the format.

Of interest to you will be:

enter image description here

For a quick dump (if you are on the SQL Server in question that created the backup), you can do select from the [msdb].[dbo].[backup*] tables.

See this article for more info.

like image 87
GalacticJello Avatar answered Sep 20 '22 21:09

GalacticJello