Wednesday, March 7, 2012

Need a query to get path for last DB backup

Help needed. I need a query (or location of that data so I can write
one) to get the file path information for the last backup taken.
Many thanks.> Help needed. I need a query (or location of that data so I can write
> one) to get the file path information for the last backup taken.
SELECT TOP 1 mf.physical_device_name
FROM msdb.dbo.backupset AS b
LEFT JOIN msdb.dbo.backupmediafamily AS mf ON b.media_set_id=mf.media_set_id
WHERE b.database_name='HeliosDB'
ORDER BY b.backup_start_date DESC
--
Tom
http://kbupdate.info/ | http://suppline.com/|||>> Help needed. I need a query (or location of that data so I can write
>> one) to get the file path information for the last backup taken.
> SELECT TOP 1 mf.physical_device_name
> FROM msdb.dbo.backupset AS b
> LEFT JOIN msdb.dbo.backupmediafamily AS mf ON
> b.media_set_id=mf.media_set_id
> WHERE b.database_name='HeliosDB'
> ORDER BY b.backup_start_date DESC
Oops, typo. Right version:
.
.
WHERE b.database_name=N'YourDatabaseName'
.
.
--
Tom
http://kbupdate.info/ | http://suppline.com/

No comments:

Post a Comment