February 21, 2010 at 8:26 am
Hi,
I am trying to do a remote backup
use master
go
Declare @vBackupPath varchar(255)
Declare @vDate varchar(85)
Declare @vTime varchar(85)
set @vDate = CONVERT(VARCHAR(8), GETDATE(), 112)
set @vTime = LEFT(REPLACE(convert(varchar, getdate(), 108), ':', ''),4)
--set @vTime = '0030'
--select @vDate+@vTime
set @vBackupPath ='\\l04\backup\RightFax_backup_'+@vDate+vTime+'.bak'
backup database RightFax
to disk = @vBackupPath
go
I keep getting error message as invalid column name 'vTime' any help would be greatly appreciated.
Thanks
February 21, 2010 at 8:38 am
copy paste error; your variable is missing the @:
set @vBackupPath ='\\l04\backup\RightFax_backup_'+@vDate+vTime+'.bak'
should be
set @vBackupPath ='\\l04\backup\RightFax_backup_'+@vDate+@vTime+'.bak'
Lowell
February 22, 2010 at 6:05 pm
Oh what a miss.. Thank you for catching it.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply