Home All Groups Group Topic Archive Search About

Return Status question....

Author
8 Dec 2005 9:41 PM
tom d
I have an EXEC like this and is part of the whole script:

EXEC ('RESTORE LOG NETOX FROM DISK = ' + '''' +
'\\10.81.60.2\D$\Des_LogShip\' + @logfiles + '''' + ' WITH DBO_ONLY, STANDBY
= ' + '''' + 'D:\LogShip_Undo\undo_LOGNETOX.ldf' + '''')

I want to know what the return status whether or not it execute
successfully. How do I do that.

Thanks,
Tomd

Author
8 Dec 2005 10:31 PM
Alejandro Mesa
Can you trying using a variable to specify from where are you restoring?

....
declare @physical_backup_device_name_var varchar(256)

set @physical_backup_device_name_var = '\\10.81.60.2\D$\Des_LogShip\' +
@logfiles

RESTORE LOG NETOX
FROM DISK = @physical_backup_device_name_var
WITH
   DBO_ONLY,
   STANDBY 'D:\LogShip_Undo\undo_LOGNETOX.ldf'

if @@error != 0
....


AMB


Show quote
"tom d" wrote:

> I have an EXEC like this and is part of the whole script:
>
> EXEC ('RESTORE LOG NETOX FROM DISK = ' + '''' +
> '\\10.81.60.2\D$\Des_LogShip\' + @logfiles + '''' + ' WITH DBO_ONLY, STANDBY
> = ' + '''' + 'D:\LogShip_Undo\undo_LOGNETOX.ldf' + '''')
>
> I want to know what the return status whether or not it execute
> successfully. How do I do that.
>
> Thanks,
> Tomd
>

AddThis Social Bookmark Button