I figured it out

declare @testvar varchar(1000)
set @testvar = 'd:\master_bob_' + convert(varchar(8),getdate(),112)  + '.bak'
BACKUP DATABASE [master] TO  DISK = @testvar  WITH  INIT ,  NOUNLOAD ,  NAME = N'master backup',  NOSKIP ,  STATS = 10,  NOFORMAT

> How would I add what day the backup was made to the filename of the
> back. here is what I am currently doing.
>
> BACKUP DATABASE [master] TO  DISK =
> N'D:\sqldata\MSSQL\Backup\master_web' WITH  INIT ,  NOUNLOAD ,  NAME =
> N'master backup',  NOSKIP ,  STATS = 10,  NOFORMAT
>
> I would like the filename to be master_web-05042004 something like
> that.
>
>
> Bob
Everland
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to