DROP PROCEDURE  IF EXISTS uspUpdateSorszam 
GO
  CREATE PROCEDURE uspUpdateSorszam
     @pSorszam INT
    ,@pUserId INT    
    ,@pId INT
    ,@pIntezmenyId INT
    ,@pTanevId INT

  AS
  BEGIN
    SET NOCOUNT ON;

    UPDATE
            T_DICTIONARYITEMBASE_OSSZES
          SET
            C_ORDER = @pSorszam,
            SERIAL = SERIAL + 1,
            LASTCHANGED = GETDATE(),
            MODIFIER = @pUserId
          WHERE
            ID = @pId AND
            C_INTEZMENYID = @pIntezmenyId AND
            C_TANEVID = @pTanevId
    
    
  END
GO