使用 SMO 查找最近的备份
有谁知道如何使用 SMO 查找数据库的最新备份?
Does anyone know how to find the most recent backup for a database using SMO?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有谁知道如何使用 SMO 查找数据库的最新备份?
Does anyone know how to find the most recent backup for a database using SMO?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
备份时间存储在表 msdb.dbo.backupset 中。 下面是一个例程,它采用打开的 SQL 连接、数据库名称和指示您是否需要完整备份或任何备份的标志,并返回上次备份的时间。
请注意,此表有时会被整理,因此如果已整理,则可能表明没有备份。
The backup times are stored in the table msdb.dbo.backupset. Here is a routine that takes an open SQLconnection, databasename and a flag indicating whether you want full backups or any backups and returns the time of the last backup.
Note that this table sometimes gets groomed so it could indicate no backups if it has been groomed.
这是不可能的。
It's not possible.