Hello, I currently have the following to get a Linked Server's last 'Full' backup date:
MAX(backup_finish_date) AS last_db_backup_date
INNER JOIN [My_Linked_Server].msdb.dbo.backupset ON backupmediafamily.media_set_id = backupset.media_set_id
inner join [My_Linked_Server].master.sys.databases ON databases.name = backupset.database_name
WHERE backupset.type = 'D' and state_desc = 'ONLINE'
I now want to remove the backupset.type = 'D' ( which references it was a Full backup) in the Where clause and return any type with a new column named 'BackupType' as Microsoft lists:
D = Database
I = Differential database
L = Log
F = File or filegroup
G =Differential file
P = Partial
Q = Differential partial
Can be NULL.
And instead of showing the one character from list above I'd like it to show the actual real Backup type spelled out that it relates to.
What would be the query that would do this (perhaps just slightly tweaking my current query) ?
Thanks in advance.