
/*------ ATD 365890 ------*/
-- SQLSERVER
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'ICMSIPI' and
          syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ITNFSAICOMPLEMENTO'))
   ALTER TABLE ITNFSAICOMPLEMENTO ADD ICMSIPI CHAR(1)
   GO
   UPDATE ITNFSAICOMPLEMENTO SET ICMSIPI = ' ' WHERE DATALENGTH(LTRIM(RTRIM(ISNULL(ICMSIPI,' ')))) = 0
   GO
   EXEC SP_BINDEFAULT 'DFLT_BRANCO','ITNFSAICOMPLEMENTO.ICMSIPI'
GO