DROP PROCEDURE OP_TURNVSSIDEDelProc
GO
CREATE PROCEDURE OP_TURNVSSIDEDelProc
(
    @SITEID               UD_IDSITE,
    @DATEPROCE            UD_FECHA,
    @NUMBERTURN           tinyint,
    @SALESPERID           UD_SALESPERSONID,
    @SIDE		  UD_CARA
)
AS
BEGIN
    BEGIN TRAN

    DELETE 
    FROM   OP_TURNVSSIDE
    WHERE SITEID=@SITEID AND @DATEPROCE=@DATEPROCE  AND NUMBERTURN=@NUMBERTURN AND SALESPERID=@SALESPERID AND SIDE=@SIDE
	    
    IF (@@error!=0 AND @@ROWCOUNT=0)
    BEGIN
	RAISERROR  20000 'Error Eliminando en OP_TURNVSSIDE '
        ROLLBACK TRAN
        RETURN(1)
    
    END

    COMMIT TRAN

END
