
/*------ ATD 452110 ------*/
-- Adicionando coluna IDTERMPAG na tabela PAGAMENTOVENDA
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'IDTERMPAG' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='PAGAMENTOVENDA')) 
ALTER TABLE PAGAMENTOVENDA ADD IDTERMPAG VARCHAR(40)
go
-- Adicionando coluna IDTERMPAG na tabela DADOSPAGAMENTONFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'IDTERMPAG' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSPAGAMENTONFE')) 
ALTER TABLE DADOSPAGAMENTONFE ADD IDTERMPAG VARCHAR(40)
go
-- Adicionando coluna DPAG na tabela DADOSPAGAMENTONFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'DPAG' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSPAGAMENTONFE')) 
ALTER TABLE DADOSPAGAMENTONFE ADD DPAG DATETIME
go
-- Adicionando coluna indDeduzDeson na tabela DADOSITEMNFE
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'INDDEDUZDESON' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='DADOSITEMNFE')) 
ALTER TABLE DADOSITEMNFE ADD INDDEDUZDESON INTEGER
go

