Declare @Dt_DateAndTime Varchar(30), @dbname sysname, @file sysname
select @Dt_DateAndTime = convert(char(8), getdate(), 112)+''+ Replace(convert(char(12), getdate(), 14),':','')
select @dbname = 'master'
select @file = 'c:\'+@dbname+'_'+@Dt_DateAndTime
select @file
backup database @dbname to disk = @file
with init
MohammedU
Microsoft SQL Server MVP