时间:2021-07-01 10:21:17 帮助过:36人阅读
在备份过程中的操作,SQLServer2005更新下列表: msdb.dbo.backupfile, msdb.dbo.backupmediaset, msdb.dbo.backupmediafamilyand msdb.dbo.backupset. 在这里,我们正在做的得到我们的数据库名,上次备份日期和备份之间的联接sys.sysdatabase和msdb.dbo.back
在备份过程中的操作,SQL Server 2005更新下列表:SELECT a.Name AS DatabaseName,COALESCE(CONVERT(VARCHAR(12),MAX(b.backup_finish_date),101),'Not Yet Taken') AS LastBackUpDate,COALESCE(CONVERT(VARCHAR(12),MAX(b.user_name),101),'NA') AS TakenBy FROM sys.sysdatabases a LEFT OUTER JOIN msdb.dbo.backupset b ON b.database_name=a.name GROUP BY a.Name ORDER BY a.Name