SQLTeam.com | Weblogs | Forums

Daily Database backup


#1

I want to make my database daily back up is following the date. For example of the result of format back up database is ' date+databasename'
can anyone help?

thanks


#2

Something,like this:

DECLARE @BackupFileName varchar(50)
SELECT @BackupFileName = 'C:\backups\mybackup_' + CONVERT (VARCHAR, GetDate(), 112) + '.bak'
BACKUP DATABASE [Development] TO  DISK = @BackupFileName WITH NOFORMAT, INIT,  
NAME = N'MyDateStampDB', SKIP, REWIND, NOUNLOAD,  STATS = 10