if (not exists(select * from sys.systable where table_name='GuaranteeDepositOperations')) then
create table GuaranteeDepositOperations (
  "N" integer not null default autoincrement,
  "GuestNo" integer not null,
  "EGN" varchar(20) not null,
  "ServiceNo" integer,
  "Suma" decimal(12,2),
  "PayType" integer,
  "Notes" varchar(200),
  "DateOperation" date,
  "OperationN" integer,
  "Returned" integer default 0,
  "UserN" integer not null,
  "InsDateTime" timestamp default current timestamp,
  primary key ("N")
);
end if

GO