DROP PROCEDURE TMP_IN_PRICELEVELTEMDETInsProc
GO
CREATE PROCEDURE TMP_IN_PRICELEVELTEMDETInsProc
(   @CORRNBR	    INT,
    @SITEID         UD_IDSITE,
    @SEQUENCE       tinyint,
    @INVTIDSKU      UD_IDCORPORATIVO,
    @DESCR	    VARCHAR(40),	
    @SLS_PRICE      UD_PRECIO,
    @DISCMTO	    UD_MONTO,
    @NEWSLS_PRICE   UD_PRECIO, --PRECIO COM IGV
    @STDCOST	    UD_COSTO
)
AS
BEGIN
    BEGIN TRAN


    INSERT INTO TMP_IN_PRICELEVELTEMDET(CORRNBR,SITEID,SEQUENCE,INVTIDSKU,DESCR,SLS_PRICE,DISCMTO,NEWSLS_PRICE,STDCOST)
    VALUES(@CORRNBR,@SITEID,@SEQUENCE,@INVTIDSKU,@DESCR,@SLS_PRICE,@DISCMTO,@NEWSLS_PRICE,@STDCOST)

    IF (@@error!=0)
    BEGIN
        ROLLBACK TRAN
        RETURN(1)
    
    END

    COMMIT TRAN

END

select * from TMP_IN_PRICELEVELTEMDET
