Adding two more columns to existing script (backup summary) Can anyone help me to add two more columns to the existing code? I am not a core developer. I want backup_size in GBs and name from msdb.dbo.backupset table, where msdb.dbo.backupset.name = **'XXXXXXX'**. I need this because we are using a third party tool for backups. That tool name is reflecting in msdb.dbo.backupset name column, so I want to filter by that name. Please see code below.

SELECT name,
       recovery_model_desc,
       state_desc,
       d AS 'Last Full Backup',
       i AS 'Last Differential Backup',
       l AS 'Last log Backup'
 FROM (SELECT db.name,
              db.state_desc,
              db.recovery_model_desc,
              type,
              backup_finish_date
        FROM   master.sys.databases db
         LEFT OUTER JOIN msdb.dbo.backupset a ON a.database_name = db.name
       ) AS Sourcetable 
 PIVOT (MAX(backup_finish_date) FOR type IN ( D, I, L )) AS MostRecentBackup
You should be able to tweak this for your needs

SELECT bs.database_name AS DbName
    ,CAST(bs.backup_size / 1024.0 / 1024 / 1024 AS DECIMAL(10, 2)) AS BackupSize_GB
    ,bs.backup_start_date AS Backup_StartDate
    ,bs.backup_finish_date AS Backup_EndDate
    ,bs.NAME AS BackupName
    ,bmf.physical_device_name AS DeviceName
FROM msdb.dbo.backupset bs
JOIN msdb.dbo.backupmediafamily bmf ON bs.media_set_id = bmf.media_set_id
WHERE bs.database_name = 'DB_Name'
  AND  bs.NAME = 'BackupSetName'
ORDER BY bs.backup_start_date DESC