finding backup file name

  • How can I find out the name of the last .bak file created? I'm looking to do this by querying db tables.

    Thanks

  • 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

  • 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