Declare @FileName varchar(100)
Set @FileName='D:\数据备份\' + convert(varchar(10),getdate(),120)+ '.bak'
BackUp Database CoalTraffic To Disk=@FileName
With Init
Declare @FileName varchar(100)
Set @FileName='D:\数据备份\' + convert(varchar(10),getdate(),120)+ '.bak'
Backup database CoalTraffic To Disk=@FileName
With Differential
declare @CreateDate datetime
select @CreateDate=getdate()-1
EXECUTE master.dbo.xp_delete_file 0,N'D:\数据备份\',N'BAK',@CreateDate