问题描述
SELECT d.name AS "数据库",
ISNULL ( CONVERT ( VARCHAR ,b.backupdate, 120 ), '从未' )
AS "最后 完全备份 "
FROM sys .databases d
$
LEFT JOIN( SELECT database_name, 类型 , MAX (backup_finish_date)backupdate
FROM backupset
WHERE 类型 LIKE
'D'
GROUP BY database_name, type )b
d.name = b.database_name
WHERE (backupdate IS NULL或backupdate<
getdate () - 1 )
SELECT d.name AS "Database",
ISNULL(CONVERT(VARCHAR,b.backupdate,120),'NEVER')AS "Last Full Backup"
FROM sys.databases d
LEFT JOIN (SELECT database_name,type,MAX(backup_finish_date) backupdateFROM backupset
WHERE type LIKE'D'
GROUP BY database_name,type) bon d.name=b.database_name
WHERE (backupdate IS NULL OR backupdate <getdate()-1)
推荐答案
请为我们提供正确的问题说明帮助你。
Please provide proper description for the issue for us to help you.
还可以添加表脚本/模式,以防用户定义的表被引用。
Also add table scripts/schema in case user defined tables are referred.
这篇关于脚本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!