Suppose there is a typo in a script and d:\backup\database.BKP does not exist. Therefore, you would expect exec master.dbo.xp_restore_filelistonly @filename ='D:\backup\database.BKP'to generate an error, that is, set @@error to 1. However, if you run
print @@error
exec master.dbo.xp_restore_filelistonly @filename ='D:\backup\database.BKP'
print @@error
you will see that @@error is zero both before and after the command. My question is, why doesn't the Litespeed extended stored procedure set the @@error variable properly?
Declare @ret int;
exec @ret = master.dbo.xp_restore_filelistonly @filename ='D:\backup\database.BKP';
select @ret;
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center