IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'license' AND COLUMN_NAME = 'Dom_ID_Guild') begin alter table dbo.license add Dom_ID_Guild int references dbo.Domain(ID) not null default -1 end; IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'license' AND COLUMN_NAME = 'Dom_ID_Startup') begin alter table dbo.license add Dom_ID_Startup int references dbo.Domain(ID) not null default -1 end; IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'license' AND COLUMN_NAME = 'ComputerName') begin alter table dbo.license add ComputerName nvarchar(100) null end;