File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,13 +76,15 @@ public List<BackupMetadata> RecentBackups()
7676 "FROM msdb.dbo.backupset s " +
7777 "INNER JOIN msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id " +
7878 "WHERE s.last_lsn >= (" +
79- "SELECT MAX(last_lsn) FROM msdb.dbo.backupset " +
80- "WHERE [type] = 'D' " +
81- "AND database_name = @dbName " +
82- "AND is_copy_only = 0" +
79+ "SELECT MAX(last_lsn) FROM msdb.dbo.backupset " +
80+ "WHERE [type] = 'D' " +
81+ "AND database_name = @dbName " +
82+ "AND is_copy_only = 0" +
83+ "AND server_name = @@SERVERNAME " +
8384 ") " +
8485 "AND s.database_name = @dbName " +
85- "AND is_copy_only = 0" +
86+ "AND is_copy_only = 0 " +
87+ "AND s.server_name = @@SERVERNAME " +
8688 "ORDER BY s.backup_start_date DESC, backup_finish_date" ;
8789
8890 using var cmd = _server . SqlConnection . CreateCommand ( ) ;
You can’t perform that action at this time.
0 commit comments