Query to find Dir Path for last backup taken.

  • Anyone know where to find the path (i.e. location) for the last backup taken for a 2005 database? I need to access this information via a SQL Query. Any help would be greatly appreciated!

    TIA

    Don

  • This might be one solution:

    select

    top 1 bs.backup_finish_date, bs.database_name, bs.server_name, bmf.physical_device_name

    from

    msdb.dbo.backupset bs

    inner

    join msdb.dbo.backupmediafamily bmf on bs.media_set_id = bmf.media_set_id

    where

    bs.database_name = 'yourdbname' and bs.type = 'D' --'L' for log backups

    order

    by bs.backup_finish_date desc

  • Thank you!!!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply