/*==============================================================*/
/* Database name: HotelManagement */
/* DBMS name: Microsoft SQL Server 2000 */
/* Created on: 2007-4-4 9:34:08 */
/*==============================================================*/
alter table Account
drop constraint FK_ACCOUNT_ACCOUNT_PINFORTA
go
alter table Accountlist
drop constraint FK_ACCOUNTL_COST_PINFORTA
go
alter table grtab
drop constraint FK_GRTAB_DINGFANG_INFORMAT
go
alter table grtab
drop constraint FK_GRTAB_YUDING_PINFORTA
go
alter table hisrecordtab
drop constraint FK_HISRECOR_KESHI_PINFORTA
go
alter table information
drop constraint FK_INFORMAT_FANGTAI_GUEROOMS
go
alter table retab
drop constraint FK_RETAB_RUZHU_PINFORTA
go
alter table retab
drop constraint FK_RETAB_ZHUFANG_INFORMAT
go
if exists (select 1
from sysindexes
where id = object_id('Account')
and name = 'account_FK'
and indid > 0
and indid < 255)
drop index Account.account_FK
go
if exists (select 1
from sysindexes
where id = object_id('Accountlist')
and name = 'cost_FK'
and indid > 0
and indid < 255)
drop index Accountlist.cost_FK
go
if exists (select 1
from sysindexes
where id = object_id('grtab')
and name = 'dingfang_FK'
and indid > 0
and indid < 255)
drop index grtab.dingfang_FK
go
if exists (select 1
from sysindexes
where id = object_id('grtab')
and name = 'yuding_FK'
and indid > 0
and indid < 255)
drop index grtab.yuding_FK
go
if exists (select 1
from sysindexes
where id = object_id('hisrecordtab')
and name = 'keshi_FK'
and indid > 0
and indid < 255)
drop index hisrecordtab.keshi_FK
go
if exists (select 1
from sysindexes
where id = object_id('information')
and name = 'fangtai_FK'
and indid > 0
and indid < 255)
drop index information.fangtai_FK
go
if exists (select 1
from sysindexes
where id = object_id('retab')
and name = 'ruzhu_FK'
and indid > 0
and indid < 255)
drop index retab.ruzhu_FK
go
if exists (select 1
from sysindexes
where id = object_id('retab')
and name = 'zhufang_FK'
and indid > 0
and indid < 255)
drop index retab.zhufang_FK
go
if exists (select 1
from sysobjects
where id = object_id('Account')
and type = 'U')
drop table Account
go
if exists (select 1
from sysobjects
where id = object_id('Accountlist')
and type = 'U')
drop table Accountlist
go
if exists (select 1
from sysobjects
where id = object_id('grtab')
and type = 'U')
drop table grtab
go
if exists (select 1
from sysobjects
where id = object_id('gueroomstate')
and type = 'U')
drop table gueroomstate
go
if exists (select 1
from sysobjects
where id = object_id('hisrecordtab')
and type = 'U')
drop table hisrecordtab
go
if exists (select 1
from sysobjects
where id = object_id('information')
and type = 'U')
drop table information
go
if exists (select 1
from sysobjects
where id = object_id('pinfortab')
and type = 'U')
drop table pinfortab
go
if exists (select 1
from sysobjects
where id = object_id('retab')
and type = 'U')
drop table retab
go
if exists (select 1
from sysobjects
where id = object_id('usertab')
and type = 'U')
drop table usertab
go
/*==============================================================*/
/* Table: Account */
/*==============================================================*/
create table Account (
AccountId int not null,
Pid int null,
total float(20) null,
Amoney float(20) null,
payed float(20) null,
limit float(20) null,
constraint PK_ACCOUNT primary key (AccountId)
)
go
/*==============================================================*/
/* Index: account_FK */
/*==============================================================*/
create index account_FK on Account (
Pid
)
go
/*==============================================================*/
/* Table: Accountlist */
/*==============================================================*/
create table Accountlist (
accid int not null,
Pid int null,
paytext varchar(200) null,
marktime datetime null,
payed float(20) null,
constraint PK_ACCOUNTLIST primary key (accid)
)
go
/*==============================================================*/
/* Index: cost_FK */
/*==============================================================*/
create index cost_FK on Accountlist (
Pid
)
go
/*==============================================================*/
/* Table: grtab */
/*==============================================================*/
create table grtab (
Sno int not null,
Pid int null,
Qid int null,
Stime datetime null,
Stimein datetime null,
Sday int null,
constraint PK_GRTAB primary key (Sno)
)
go
/*==============================================================*/
/* Index: yuding_FK */
/*==============================================================*/
create index yuding_FK on grtab (
Pid
)
go
/*==============================================================*/
/* Index: dingfang_FK */
/*==============================================================*/
create index dingfang_FK on grtab (
Qid
)
go
/*==============================================================*/
/* Table: gueroomstate */
/*==============================================================*/
create table gueroomstate (
Rno int not null,
Rstatedescribe varchar(20) null,
constraint PK_GUEROOMSTATE primary key (Rno)
)
go
/*==============================================================*/
/* Table: hisrecordtab */
/*==============================================================*/
create table hisrecordtab (
Lhno int not null,
Pid int null,
Ltime datetime null,
Lquitime datetime null,
Lnumday int null,
Lconpri float(20) null,
c