SQLServerWiki

“The Only Thing That Is Constant Is Change”

Which Transaction Log to apply after restoring the full backup.

Posted by database-wiki on July 10, 2012

declare curs_names cursor read_only forward_only for

Select  f.physical_device_name

From .msdb.dbo.backupset s, msdb.dbo.backupmediaset m, .msdb.dbo.backupmediafamily f

Where (s.type = ‘L’)– And s.database_name = ‘procdb’ And

— s.backup_start_date > ’03/09/2007 19:45:00′  and

–s.backup_start_date <  ’03/11/2007 21:15:00′  and

s.media_set_id = m.media_set_id and

m.media_set_id = f.media_set_id order by backup_start_date

declare @cpname varchar(512)

open curs_names

fetch next from curs_names into @cpname

while @@fetch_status = 0

BEGIN

print @cpname

fetch next from curs_names into @cpname end

close curs_names

deallocate curs_names

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: