

IF NOT EXISTS 
   (SELECT 1 
      FROM INFORMATION_SCHEMA.COLUMNS 
      WHERE TABLE_NAME = 'EST_PROD_BALAN_CRONOGRAMA' 
         AND COLUMN_NAME = 'STS_AGENDAMENTO')
BEGIN

   ALTER TABLE EST_PROD_BALAN_CRONOGRAMA
      ADD STS_AGENDAMENTO  INT  NOT NULL  DEFAULT( 0 )

END



IF NOT EXISTS 
   (SELECT 1 
      FROM INFORMATION_SCHEMA.COLUMNS 
      WHERE TABLE_NAME = 'EST_PROD_BALAN_CRONOGRAMA' 
         AND COLUMN_NAME = 'TIPO_AGENDAMENTO')
BEGIN

   ALTER TABLE EST_PROD_BALAN_CRONOGRAMA
      ADD TIPO_AGENDAMENTO  INT  NOT NULL  DEFAULT( 0 )

END

