declare @backdevice varchar(1000)
select @backdevice= 'D:\MSSQL\sqlbackup\db_name_ '+convert(varchar,year(getdate()))+convert(varchar,month(getdate()))+convert(varchar,day(getdate()))+ '.BAK ' --按年月日的格式生成备份的文件名字
backup database db_name to disk=@backdevice