drop table #a
select identity(int,1,1) as Id, table_name, column_name, Is_Nullable, Data_Type
into #a
from INFORMATION_SCHEMA.COLUMNS where column_name='ModelID' and Data_Type<>'Bigint'
select * from #a
declare @Id int
declare @table nvarchar(50)
declare @column nvarchar(50)
declare @is_nullable nvarchar(50)
set @Id=1
while @Id<=(select max(id) from #a)
begin
set @table=(select table_name from #a where id=@id)
set @column=(select column_name from #a where id=@id)
set @is_nullable=case when (select is_nullable from #a where id=@id)='No' then 'not null' else '' end;
print @table
print @column
print @is_nullable
alter table @table alter @column Bigint @is_nullable
set @id=@id+1
continue
end