Red Gate forums :: View topic - What's the easiest way to get the metadata from sqb files?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 6
SQL Backup 6 forum

What's the easiest way to get the metadata from sqb files?

Search in SQL Backup 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
ogrishman



Joined: 12 Apr 2010
Posts: 24

PostPosted: Fri Apr 20, 2012 3:20 pm    Post subject: What's the easiest way to get the metadata from sqb files? Reply with quote

Hi,

For example, if I have some sqb files located in c:\temp, what's the easiest way to get the meta information(such as first lsn last lsn etc) in a easy to use form from them? The following code is currently what I have, but I have difficult in getting the individual item value. Hope you can give me some suggestions. Thanks.

Code:
CREATE TABLE sqb
(
 id INT IDENTITY
        PRIMARY KEY,
 DATA NVARCHAR(1000)
)


INSERT INTO sqb
EXECUTE master..sqlbackup '-sql "RESTORE SQBHEADERONLY
FROM DISK = [c:\temp\*.sqb] WITH SINGLERESULTSET"'


SELECT * FROM sqb;
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 309
Location: Cambridge, UK

PostPosted: Mon Apr 23, 2012 2:01 pm    Post subject: Reply with quote

Thank you for your post.

You could use the command RESTORE HEADERONLY which will display table of data retrieved (e.g. FirstLSN and LastLSN). But please be aware that this can take some time to run as it needs to parse the whole file to retrieve the info.

http://msdn.microsoft.com/en-us/library/ms178536.aspx
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2277

PostPosted: Tue Apr 24, 2012 3:48 am    Post subject: Reply with quote

Presently, SQL Backup cannot display the results of reading the backup file headers in table form.
_________________
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group