March 12, 2007 at 9:28 am
Hi:
i need to add timestamp to automatic generated backup files, these are full database backups, using jobs from management SQL server agent.
The idea is to archive this backups that i set to be maiden once a day, and identified them from the timestamp (date).
Thanks a lot
FB
March 12, 2007 at 4:22 pm
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
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy