if not exists(select 1 from syscolumns where id = object_id('EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO') and name = 'DT_DEVOLUCAO')
begin 
	ALTER TABLE dbo.EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO ADD
		DT_DEVOLUCAO datetime NULL;
end

if not exists(select 1 from syscolumns where id = object_id('EST_NF_ENT_IT_DEVOLUCAO') and name = 'DT_DEVOLUCAO')
begin 
	ALTER TABLE dbo.EST_NF_ENT_IT_DEVOLUCAO ADD
		DT_DEVOLUCAO datetime NULL;
	
end
go
UPDATE
	EST_NF_ENT_DANFE_PROVISORIO_ITENS_DEVOLUCAO
SET
	DT_DEVOLUCAO=CONVERT(CHAR(10),GETDATE(),112)
go
UPDATE
	EST_NF_ENT_IT_DEVOLUCAO
SET
	DT_DEVOLUCAO=CONVERT(CHAR(10),GETDATE(),112)
