if not exists(select * from sys.systable where lcase(table_name) = lcase('GuestPhotos')) then create table GuestPhotos( "N" integer not null default autoincrement, "Photo" long binary not null, primary key("N") ) end if; go if not exists(SELECT column_name from sys.syscolumn sc join sys.systable st on sc.table_id = st.table_id where LCase(table_name) = LCase('Guests') and LCase(column_name) = LCase('PhotoID')) then alter table Guests add "PhotoID" integer; end if;