if (Exists (Select Table_name from SysTable where Table_name='SpaGuests')) then Drop Table SpaGuests end if GO Create table SpaGuests ( GuestNum integer NOT NULL , HumanKind integer NULL DEFAULT 2 , Name varchar(40) NULL, EGN varchar(18) NULL , Address varchar(50) NULL , PassportNumber varchar(20) NULL , PassportWhere varchar(20) NULL , PaspValDate date NULL DEFAULT current date , PaspValidity integer NULL DEFAULT 1 , NativeCountry integer NULL DEFAULT -1 , City varchar(20) NULL , Sex char(1) NULL DEFAULT ' ' , BirthDateDt date NULL , PassportDateDt date NULL ) GO if (select count(*) from sys.syscolumns where tname='Counters' and cname='SpaGuestCounter')=0 then alter table Counters Add SpaGuestCounter integer NULL end if GO if (select count(*) from sys.syscolumns where tname='SpaReservations' and cname='GuestType')=0 then alter table SpaReservations Add GuestType integer not null default 0 end if GO COMMENT ON COLUMN SpaReservations.GuestType is '0-gosa e ot Guests 1-gosta e ot SpaGuests'