
/*------ ATD 323616 ------*/
-- Adicionando coluna CM_PIS na tabela CLAFISCCAD
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'CLAFISCCAD' AND COLUMN_NAME = 'CM_PIS')
alter TABLE CLAFISCCAD add CM_PIS CHAR(2)
go
-- Adicionando coluna CM_COFINS na tabela CLAFISCCAD
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'CLAFISCCAD' AND COLUMN_NAME = 'CM_COFINS')
alter TABLE CLAFISCCAD add CM_COFINS CHAR(2)
go

-- Adicionando coluna CM_PIS na tabela ITNFSAICOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFSAICOMPLEMENTO' AND COLUMN_NAME = 'CM_PIS')
alter TABLE ITNFSAICOMPLEMENTO add CM_PIS CHAR(2)
go
-- Adicionando coluna CM_COFINS na tabela ITNFSAICOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFSAICOMPLEMENTO' AND COLUMN_NAME = 'CM_COFINS')
alter TABLE ITNFSAICOMPLEMENTO add CM_COFINS CHAR(2)
go

-- Adicionando coluna CM_PIS na tabela ITNFENTCOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFENTCOMPLEMENTO' AND COLUMN_NAME = 'CM_PIS')
alter TABLE ITNFENTCOMPLEMENTO add CM_PIS CHAR(2)
go
-- Adicionando coluna CM_COFINS na tabela ITNFENTCOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFENTCOMPLEMENTO' AND COLUMN_NAME = 'CM_COFINS')
alter TABLE ITNFENTCOMPLEMENTO add CM_COFINS CHAR(2)
go

/*------ ATD 323616 ------*/
-- Adicionando coluna CM_PIS na tabela CLAFISCCAD
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'CLAFISCCAD' AND COLUMN_NAME = 'CM_PIS')
alter TABLE CLAFISCCAD add CM_PIS CHAR(2)
go
-- Adicionando coluna CM_COFINS na tabela CLAFISCCAD
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'CLAFISCCAD' AND COLUMN_NAME = 'CM_COFINS')
alter TABLE CLAFISCCAD add CM_COFINS CHAR(2)
go

-- Adicionando coluna CM_PIS na tabela ITNFSAICOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFSAICOMPLEMENTO' AND COLUMN_NAME = 'CM_PIS')
alter TABLE ITNFSAICOMPLEMENTO add CM_PIS CHAR(2)
go
-- Adicionando coluna CM_COFINS na tabela ITNFSAICOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFSAICOMPLEMENTO' AND COLUMN_NAME = 'CM_COFINS')
alter TABLE ITNFSAICOMPLEMENTO add CM_COFINS CHAR(2)
go

-- Adicionando coluna CM_PIS na tabela ITNFENTCOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFENTCOMPLEMENTO' AND COLUMN_NAME = 'CM_PIS')
alter TABLE ITNFENTCOMPLEMENTO add CM_PIS CHAR(2)
go
-- Adicionando coluna CM_COFINS na tabela ITNFENTCOMPLEMENTO
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITNFENTCOMPLEMENTO' AND COLUMN_NAME = 'CM_COFINS')
alter TABLE ITNFENTCOMPLEMENTO add CM_COFINS CHAR(2)
go
