WITH (ROWLOCK, REPEATABLEREAD) WHERE ActivityID = @RowID END IF (@IsStartNew = 1) BEGIN SET @IsVisible = 1 END IF (@RowID ...

WITH (ROWLOCK, REPEATABLEREAD)
                  WHERE ActivityID = @RowID
              END
              
              IF (@IsStartNew = 1)
              BEGIN
                  SET @IsVisible = 1
              END

              IF (@RowID = @ActivityID)    -- current trace is main trace or a new trace
              BEGIN
                  SET @MarkMainTraceComplete = @IsComplete
              END
              ELSE IF (@IsComplete = 1)    -- current trace is a continuation
              BEGIN
                  -- Try to delete it from continuation table if completed
                  DELETE 
                  FROM
English
English (United States)
Deutsch (Deutschland)
German (Germany)
Español (España)
Spanish (Spain)
Français (France)
French (France)
日本語
Japanese
한국어
Korean