--備份數據庫
declare @FileName varchar(240)
if datename(weekday, getdate())='星期三'
begin
select @FileName='Db星期三.bak'
end
else
begin
select @FileName='DbAutoBack.bak'
end
set @FileName='E:\DbBackUp\'+ @FileName
Backup DATABASE
CC3 to disk=@FileName
with format --強制備份 (不會追加到原有備份中)