• Try moving the variables/parameters to the WHERE clause. Having them as part of the join condition may be causing the stored procedure to recompile each time it is called.

    update dbo.tMappingRule

    set ratio = r.ratio

    from dbo.tMappingRule mr

    inner join tMappingTemplateRule r

    on r.AccountID = mr.AccountID

    and r.LevelID = mr.levelID

    WHERE mr.DataCycleID = @DataCycleID

    and r.MappingTemplateID = @MappingTemplateID