|
Posted by Erland Sommarskog on 05/26/05 10:00
Steve (fizzy1236@yahoo.com) writes:
> Thanks, I will give a good read through and rework this. Not too happy
> with Microsoft's documentation, as they state I should be able to do
> this. From Sql Server Books Online...
>
> -- Save any non-zero @@ERROR value.
> IF (@@ERROR <> 0)
> SET @ErrorSave = @@ERROR
>
> Found in the using @@ERROR section.
See below for a link to an updated version of Books Online. It is indeed
an embarrssing error. But the same section also says:
Because @@ERROR is cleared and reset on each statement executed, check
it immediately following the statement validated, or save it to a local
variable that can be checked later.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
[Back to original message]
|