IF EXISTS (select 1 from syscolumns where id = object_id('EST_PROD_TRANSF_LACRE') and name = 'CD_CTR_MINUTA')
BEGIN
	UPDATE A
	SET A.CD_CTR_MINUTA = B.CD_CTR_MINUTA
	FROM EST_PROD_TRANSF_LACRE A
	JOIN EST_PROD_TRANSF_MINUTA_ENTREGA_CPL B ON
	B.CD_EMP = A.CD_EMP AND
	B.CD_FILIAL = A.CD_FILIAL AND
	B.CD_CTR = A.CD_CTR
	WHERE A.CD_CTR_MINUTA IS NULL
END