declare @DefName varchar(255)
  set @DefName = (select top 1 name from sys.objects WHERE parent_object_id = OBJECT_ID(N'[dbo].[VAJ1]') and name like 'DF__VAJ1__VAJ23__%')
  if @DefName is not null
    exec ('ALTER TABLE VAJ1 drop CONSTRAINT ' + @DefName) 
  set @DefName = (select top 1 name from sys.objects WHERE parent_object_id = OBJECT_ID(N'[dbo].[VAJ2]') and name like 'DF__VAJ2__VAJ23__%')
  if @DefName is not null
    exec ('ALTER TABLE VAJ2 drop CONSTRAINT ' + @DefName) 
  set @DefName = (select top 1 name from sys.objects WHERE parent_object_id = OBJECT_ID(N'[dbo].[VAJ1_2]') and name like 'DF__VAJ1_2__VAJ23__%')
  if @DefName is not null
    exec ('ALTER TABLE VAJ1_2 drop CONSTRAINT ' + @DefName) 
  set @DefName = (select top 1 name from sys.objects WHERE parent_object_id = OBJECT_ID(N'[dbo].[VAJ2_2]') and name like 'DF__VAJ2_2__VAJ23__%')
  if @DefName is not null
    exec ('ALTER TABLE VAJ2_2 drop CONSTRAINT ' + @DefName) 
  set @DefName = (select top 1 name from sys.objects WHERE parent_object_id = OBJECT_ID(N'[dbo].[VAJ2_dev]') and name like 'DF__VAJ2_dev__VAJ23__%')
  if @DefName is not null
    exec ('ALTER TABLE VAJ2_dev drop CONSTRAINT ' + @DefName) 
 
 alter table VAJ1 alter column VAJ23 int
 alter table VAJ2 alter column VAJ23 int
 alter table VAJ1_2 alter column VAJ23 int
 alter table VAJ2_2 alter column VAJ23 int
 alter table VAJ2_dev alter column VAJ23 int

if not exists(select * from syscolumns where name = 'BDA01' and object_Name(id)='VBQ1')
  alter table VBQ1 add BDA01 varchar(2)
if not exists(select * from syscolumns where name = 'BDA01' and object_Name(id)='VBQ1_2')
  alter table VBQ1_2 add BDA01 varchar(2)
if not exists(select * from syscolumns where name = 'BDA01' and object_Name(id)='VBQ2')
  alter table VBQ2 add BDA01 varchar(2)
if not exists(select * from syscolumns where name = 'BDA01' and object_Name(id)='VBQ2_2')
  alter table VBQ2_2 add BDA01 varchar(2)
if not exists(select * from syscolumns where name = 'BDA01' and object_Name(id)='VBQ2_dev')
  alter table VBQ2_dev add BDA01 varchar(2)

