IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE ID = OBJECT_ID('EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA') AND name = 'ANO_MES_EMI')
begin
ALTER TABLE dbo.EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA ADD
	CD_UF int NOT NULL CONSTRAINT DF_EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA_CD_UF DEFAULT 0,
	ANO_MES_EMI VARCHAR(4) NOT NULL CONSTRAINT DF_EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA_ANO_MES_EMI DEFAULT '',
	CNPJ VARCHAR(20) NOT NULL CONSTRAINT DF_EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA_CNPJ DEFAULT '',
	SERIE int NOT NULL CONSTRAINT DF_EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA_SERIE DEFAULT 0,
	NR_NF int NOT NULL CONSTRAINT DF_EST_PED_VD_DEVOLUCAO_NFE_CHAVE_REFERENCIA_NR_NF DEFAULT 0,
end