DECLARE @DBPATH NVARCHAR(200) SET @DBPATH=CONVERT(VARCHAR,GETDATE(),120 ) SET @DBPATH=REPLACE(@DBPATH,'-','') SET @DBPATH=REPLACE(@DBPATH,' ','') SET @DBPATH=REPLACE(@DBPATH,':','') SET @DBPATH='D:/DBBACKUP/'+@DBPATH+'.bak' BACKUP DATABASE [DATABASENAME] TO DISK = @DBPATH WITH NOINIT,NOUNLOAD,NOSKIP,STATS=10,NOFORMAT