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