保留一周的数据
declare @d Nvarchar(64);set @d = convert(varchar,dateadd(day,-7,getdate()),120);EXECUTE master.dbo.xp_delete_file 0,N'N:\OA数据备份',N'bak',@d;EXECUTE master.dbo.xp_delete_file 0,N'N:\OA数据备份',N'bak',@d