IF EXISTS (SELECT 1 FROM dbo.sysobjects WHERE ID = OBJECT_ID(N'[dbo].[sp_fco_baja_traslados_fpo]') 
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
   DROP PROCEDURE dbo.sp_fco_baja_traslados_fpo
GO
CREATE PROCEDURE dbo.sp_fco_baja_traslados_fpo(
@i_compania		char(4),
@i_trabajador		char(10),
@pdt_fecha smalldatetime
)
AS
BEGIN
	BEGIN TRANSACTION
	DELETE  fco_traslados_fpo
		WHERE compania = @i_compania
		AND trabajador = @i_trabajador
        AND fecha_cambio = @pdt_fecha
	IF @@error <> 0
	   BEGIN
		ROLLBACK TRANSACTION
		RETURN
	END
	COMMIT TRANSACTION 
END 
GO
GRANT EXECUTE ON sp_fco_baja_traslados_fpo TO Public
GO