DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Backup Database With Date Timestap In Filename
// 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




