IF (Not EXISTS(select * from sys.syscolumn as C, sys.systable as T
where LCase(T.table_name) = LCase('Classes') and LCase(C.column_name) = LCase('ExternalRoomClassId') and C.table_id=T.table_id)) THEN
  alter table Classes add ExternalRoomClassId integer
END IF

GO