Hi,
I was wondering if the following code will work after an Insert statement.
-- Check For Errors
SELECT @myERROR = @@ERROR, @myRowCount = @@ROWCOUNT
IF @myERROR != 0 GOTO HANDLE_ERROR
RETURN 0
SET @OrderId = SCOPE_IDENTITY()
Will the SET @OrderId = SCOPE_IDENTITY() still give the id that was created if it comes after the error check?