Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is the backup path stored anywhere?
Message
General information
Forum:
Microsoft SQL Server
Category:
Backups
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01127136
Message ID:
01127315
Views:
9
This message has been marked as the solution to the initial question of the thread.
>I can query the server to find out when a particular database was backed up (something like this: SELECT MAX(backup_finish_date) FROM msdb..backupset WHERE type='D' AND database_name= 'myDB')
>Is there a way to query a table to find out the what the path and filename where the last backup was placed?

Try
SELECT bks.backup_finish_date, bmf.physical_device_name
	FROM msdb..backupset bks 
	JOIN msdb.dbo.backupmediafamily bmf
		ON bmf.media_set_id = bks.media_set_id
	WHERE type='D' 
		AND database_name= 'myDB'
		AND backup_finish_date = ( 
			SELECT MAX(backup_finish_date) 
				FROM msdb..backupset bks2
				WHERE bks2.type = bks.type AND bks2.database_name = bks.database_name)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform