Backup Database With Date Timestap In Filename
Join the DZone community and get the full member experience.
Join For Free// SQL Server 2005
DECLARE @filename nvarchar(128)
SET @filename=N'C:\Backup\master' + '_' +convert(varchar(8), getdate(), 112) + '_' + replace(convert(varchar(8), getdate(), 108), ':', '') + '.bak'
BACKUP DATABASE [master] TO DISK = @filename WITH NOINIT , NOUNLOAD , NAME = N'master backup', SKIP , STATS = 10, DESCRIPTION = N'master System Backup', NOFORMAT
Backup
Database
Opinions expressed by DZone contributors are their own.
Comments