
/*------ ATD 405899 ------*/
-- Adicionando coluna DIFERENCABASE na tabela ITNFSAICOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'DIFERENCABASE' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ITNFSAICOMPLEMENTO')) 
ALTER TABLE ITNFSAICOMPLEMENTO ADD DIFERENCABASE NUMERIC(15,2) null default 0
go

-- Adicionando coluna BASEEXCEDENTE na tabela ITNFSAICOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'BASEEXCEDENTE' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ITNFSAICOMPLEMENTO')) 
ALTER TABLE ITNFSAICOMPLEMENTO ADD BASEEXCEDENTE NUMERIC(15,2) null default 0
go

-- Adicionando coluna DIFERENCABASE na tabela ITNFENTCOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'DIFERENCABASE' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ITNFENTCOMPLEMENTO')) 
ALTER TABLE ITNFENTCOMPLEMENTO ADD DIFERENCABASE NUMERIC(15,2) null default 0
go

-- Adicionando coluna BASEEXCEDENTE na tabela ITNFENTCOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'BASEEXCEDENTE' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ITNFENTCOMPLEMENTO')) 
ALTER TABLE ITNFENTCOMPLEMENTO ADD BASEEXCEDENTE NUMERIC(15,2) null default 0
go

-- Adicionando coluna DIFERENCABASE na tabela CFOSAIDCAD
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'DIFERENCABASE' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='CFOSAIDCAD')) 
ALTER TABLE CFOSAIDCAD ADD DIFERENCABASE NUMERIC(15,2) null default 0
go

-- Adicionando coluna DIFERENCABASE na tabela CFOENTRCAD
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'DIFERENCABASE' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='CFOENTRCAD')) 
ALTER TABLE CFOENTRCAD ADD DIFERENCABASE NUMERIC(15,2) null default 0
go