CharID 如果没有索引加上索引试试.

解决方案 »

  1.   

    usp_Update_CharsPVPData_E --这个是什么,你的存储过程中没有循环的东西啊
      

  2.   

    理论上说还是有点不严格的,
    你的@@error 如果第二个NULL的判断满足的前提 第一个UPdate出错你这样判断就会有问题了
      

  3.   

    SET NOCOUNT ON DECLARE @ServerID int 
    declare @K int
    SET @ServerID = 1 set @K=@K1+@K2+@K3+@K4UPDATE Chars 
    SET [Level] = @Level, StatPoint = @StatPoint, SkillPoint = @SkillPoint, 
    [Str] = @Str, dex = @Dex, Rec = @Rec, [int] = @Int, Wis = @Wis, Luc = @Luc, 
    HP = @Hp, Mp = @Mp, Sp = @Sp, 
    Map = @Map, dir = @Dir, [exp] = @Exp, [money] = @Money, 
    PosX = @Posx, PosY = @PosY, PosZ = @PosZ, hg = @Hg, vg = @Vg, cg = @Cg, og = @Og, ig = @Ig, 
    KillLevel=@KillLevel, DeadLevel=@DeadLevel,LeaveDate=GETDATE() ,
    SET K1=case when @K is null then K1 else @K1 end,
    set K2=case when @K is null then K2 else @K2 end,
    set K3=case when @K is null then K3 else @K3 end,
    set K4=case when @K is null then K4 else @K4 end
    WHERE CharID = @CharID 
    IF(@@ERROR = 0 AND @@ROWCOUNT = 1) 
    RETURN 1 
    ELSE 
    RETURN -1 SET NOCOUNT OFF 
      

  4.   

    K1=case when @K is null then K1 else @K1 end,
    K2=case when @K is null then K2 else @K2 end,
    K3=case when @K is null then K3 else @K3 end,
    K4=case when @K is null then K4 else @K4 end