I'm trying to create daily backup of my local databases. Currently I'm testing below code, but of course not sucessfull.
Well, code is working, but I would like to have daily different file names. I have in mind for bak files to include also a date. So, that each daily file would have name associated to day of backup.
When I have execute below code Sql server show me error: Incorrect sintax near '+'.
BACKUP DATABASE Test1
TO DISK = 'D:\Backups\Test_' + getdate + '.Bak'
MEDIANAME = 'Z_SQLServerBackups',
NAME = 'Full Backup of Test;
Thanks in advance for help.