rocky
SSCrazy
Points: 2120
More actions
April 1, 2008 at 1:24 pm
#379528
How can I find out the name of the last .bak file created? I'm looking to do this by querying db tables.
Thanks
Michael Valentine Jones
SSC Guru
Points: 64818
April 1, 2008 at 1:47 pm
#796831
You can pick the data from this query that you need.
select
a.*,
b.*
from
msdb.dbo.backupset a
join
msdb.dbo.backupmediafamily b
on a.media_set_id = b.media_set_id
N J
Right there with Babe
Points: 732
#796832
select top 1 b.database_name ,m.physical_device_name
from backupset b join backupmediafamily m
on b.media_set_id = m.media_set_id
order by b.backup_finish_date DESC
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply