January 15, 2008 at 1:01 pm
I need to backup my transaction logs to disk but I want to append the date time atleast to the minute but I am having problems getting by dealing with datetime and getdate().
EX.
log 1
backup log dbase to disk = 'c:\dbase_transdump011508_1430'
log2
backup log dbase to disk = 'c:\dbase_transdump011508_1500'
Any assistance would be helpful.
January 16, 2008 at 7:29 am
Thanks however I am trying to append getdate to the end then do as you described. I am struggling with getdate(0) conversion I guess.
January 17, 2008 at 8:15 am
see if this helps
declare @dumpdest char(100)
declare @date varchar(20)
select @date = convert(varchar,getdate(),112) + convert(varchar,getdate(),108)
select @date = stuff(@date,charindex(':',@date),1,'_')
select @date = stuff(@date,charindex(':',@date),1,'_')
set @dumpdest = 'c:\junk\db1_' + @date + '.tdmp'
backup log db1 to disk = @dumpdest with init
go
declare @dumpdest char(100)
declare @date varchar(20)
select @date = convert(varchar,getdate(),112) + convert(varchar,getdate(),108)
select @date = stuff(@date,charindex(':',@date),1,'_')
select @date = stuff(@date,charindex(':',@date),1,'_')
set @dumpdest = 'c:\junk\db2_' + @date + '.tdmp'
backup log db2 to disk = @dumpdest
go
January 17, 2008 at 9:48 am
In the backup section, there are lots of scripts to do this.
January 17, 2008 at 2:24 pm
71 camaro (1/16/2008)
Thanks however I am trying to append getdate to the end then do as you described. I am struggling with getdate(0) conversion I guess.
I mean you attach the content from GETDATA() function, then attache it to the @sql variable.
Hopefully, it helps.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply