if not exists(select 1 from syscolumns where id = object_id('EST_NF_ENT_DANFE_PROVISORIO_ITENS') and name = 'PERC_CRED_ICMS_SIMPLES')
begin 
	ALTER TABLE dbo.EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD
		PERC_CRED_ICMS_SIMPLES money NULL,
		VLR_CRED_ICMS_SIMPLES money NULL,
		ORIGEM int NULL

	ALTER TABLE dbo.EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD CONSTRAINT
		DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_PERC_CRED_ICMS_SIMPLES DEFAULT 0 FOR PERC_CRED_ICMS_SIMPLES

	ALTER TABLE dbo.EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD CONSTRAINT
		DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_VLR_CRED_ICMS_SIMPLES DEFAULT 0 FOR VLR_CRED_ICMS_SIMPLES

	ALTER TABLE dbo.EST_NF_ENT_DANFE_PROVISORIO_ITENS ADD CONSTRAINT
		DF_EST_NF_ENT_DANFE_PROVISORIO_ITENS_ORIGEM DEFAULT 0 FOR ORIGEM
end