查看数据库备份时间 服务器上每天有一个job执行数据库备份。(这个job有很多其他步骤,数据备份只是其中一步)例如,会将备份的数据放在D\BackDB\DB.bat,有什么办法可以得知数据库最后备份完的时间。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就看下这个D\BackDB\DB.bat的文件修改日期 可以通过下面语句只是该备份文档的备份信息Restore filelistonly from disk='d:\backup\BIL\BIL_Full071009.bak' 数据库的强项不是搞这个的。 这个 看看 http://www.cnblogs.com/RobotTech/archive/2008/02/13/1067905.html 我查看了连接,使用存储过程可以实现我要的结果。因为数据库不是我们的,所以我们只能查看,不能再数据中新增任何表以及存储过程。不知道是否有人可以将如下代码转换sql语句。/* 获取文件最后访问日期 @filepath 文件路径,如: c:\1.txt @filedate 文件最后访问日期 调用示例: declare @dt varchar(20) exec getFileLastAccessDate 'c:\1.txt',@dt output select @dt*/create procedure getFileLastAccessDate @filepath varchar(4000), @filedate varchar(20) outputas declare @obj int,@file int declare @fileexists varchar(10) exec sp_oacreate 'Scripting.FileSystemObject',@obj output exec sp_oamethod @obj,'FileExists',@fileexists output,@filepath if @fileexists='False' begin set @filedate='文件不存在' return end exec sp_oamethod @obj,'GetFile',@file output,@filepath exec sp_oagetproperty @file,'DateLastAccessed',@filedate output 急 sqlserver2000 企业管理器-local(Windows NT)-数据库展不开了 如何解决 谢谢 怎么用SQL语句实现插入binary(n)类型的数据呢? 谁教教我怎么把这两句相减 怎么实现级联删除两张表的数据 导入 导出 请教高手一个SQL的复合查询的问题? SQL2008新建登录名不勾选sysadmin不能登陆是怎么搞的 熟悉pubs的请进(字段的翻译) test 人人都参与! 关于日期查询的问题 一条不知道是简单还是复杂的sql语句,高手帮忙 求高手指点一条SQL语句,求高手指点,谢谢啦!
可以通过下面语句只是该备份文档的备份信息
Restore filelistonly from disk='d:\backup\BIL\BIL_Full071009.bak'
获取文件最后访问日期
@filepath 文件路径,如: c:\1.txt
@filedate 文件最后访问日期 调用示例:
declare @dt varchar(20)
exec getFileLastAccessDate 'c:\1.txt',@dt output
select @dt
*/
create procedure getFileLastAccessDate
@filepath varchar(4000),
@filedate varchar(20) output
as
declare @obj int,@file int
declare @fileexists varchar(10)
exec sp_oacreate 'Scripting.FileSystemObject',@obj output
exec sp_oamethod @obj,'FileExists',@fileexists output,@filepath
if @fileexists='False'
begin
set @filedate='文件不存在'
return
end
exec sp_oamethod @obj,'GetFile',@file output,@filepath
exec sp_oagetproperty @file,'DateLastAccessed',@filedate output