
/*------ ATD 283864 ------*/
IF NOT EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'BLOQUEIAABASTECIMENTO' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ItemFilEst'))
alter TABLE dbo.ItemFilEst add BLOQUEIAABASTECIMENTO Numeric(1,0) NULL
go
IF EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'BLOQUEIAABASTECIMENTO' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ItemFilEst'))
update ItemFilEst set BLOQUEIAABASTECIMENTO = 0
go
IF EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'BLOQUEIAABASTECIMENTO' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ItemFilEst'))
alter table ItemFilEst alter column BLOQUEIAABASTECIMENTO Numeric(1,0) not null
go
IF EXISTS (SELECT 1 FROM SYSCOLUMNS WHERE name = 'BLOQUEIAABASTECIMENTO' and syscolumns.id IN (SELECT ID FROM SYSOBJECTS WHERE xtype='U' AND name='ItemFilEst'))
exec sp_bindefault 'UW_ZeroDefault','ItemFilEst.BLOQUEIAABASTECIMENTO'
GO