
/*------ ATD 440329 ------*/
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'ITEMFILEST' ) 
    and NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITEMFILEST' and COLUMN_NAME = 'BloquearTransferencia' ) 
begin
    ALTER TABLE ITEMFILEST ADD BloquearTransferencia tinyint null;
end
go

IF  EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITEMFILEST' and COLUMN_NAME = 'BloquearTransferencia' ) 
begin
    update ITEMFILEST set BloquearTransferencia = 0
end 
go


IF  EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITEMFILEST' and COLUMN_NAME = 'BloquearTransferencia' ) 
begin
    alter table ITEMFILEST alter column BloquearTransferencia smallint not null
end
go


IF  EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ITEMFILEST' and COLUMN_NAME = 'BloquearTransferencia' ) 
begin
    exec sp_bindefault 'UW_ZeroDefault','ITEMFILEST.BloquearTransferencia'
end
go