Repeat contact cursor

  • gconte 55278


    Points: 471

    Hi Jeff, I was able to update the working table, data smear and NULLing with the fields necessary to populate the information of the original record, on the repeats. It runs perfect in analyzer, however SQL2000 does not support the INCLUDE statement for indexes. If I place it in a stored procedure, I get the error "INDEX ID 1 does not exist". I tried creating the index:

    CREATE INDEX AK_#QU_FirstIRRepeat ON #QU (FirstIR,HasRepeat)

    -- Include not supported INCLUDE (FirstIR,HasRepeat)

    and referencing it by name:

    UPDATE tgt

    SET @FirstIR = FirstIR = CASE WHEN RC = 1 THEN @FirstIR ELSE IRNumber END

    ,@FChannelDesc = FChannelDesc = CASE WHEN RC = 1 THEN @FChannelDesc ELSE ChannelDesc END

    ,@FIRDate = FIRDate = CASE WHEN RC = 1 THEN @FIRDate ELSE IRDate END

    ,@FOrgDesc = FOrgDesc = CASE WHEN RC = 1 THEN @FOrgDesc ELSE OrgDesc END

    ,@FCreatedBy = FCreatedBy = CASE WHEN RC = 1 THEN @FCreatedBy ELSE CreatedBy END

    ,@FCat1desc = FCat1desc = CASE WHEN RC = 1 THEN @FCat1desc ELSE Cat1desc END

    ,@SafetyCounter = CASE WHEN RowNum = @SafetyCounter THEN @SafetyCounter + 1 ELSE 'Safety Counter Failed' END

    FROM #QU tgt



    ,but still receive the same error. It's runs, in a few min with the test data (50k records), but I would like to run it again on the 16 million records. How can I reference this index properly?

    Thank you

Viewing post 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply