物业管理系统
go
alter table 楼宇信息
drop constraint FK_楼宇信息_拥有的_小区信息 go
alter table 清洁管理
drop constraint FK_清洁管理_保洁_小区信息 go
alter table 维修
drop constraint FK_维修_维修_设备信息 go
alter table 维修
drop constraint FK_维修_维修2_小区信息 go
alter table 设备信息
drop constraint FK_设备信息_设备管理_小区信息 go
alter table 车位
drop constraint FK_车位_拥有_小区信息 go
if exists (select 1
from sysindexes
where id = object_id('住户信息') and name = '入住2_FK' and indid > 0 and indid < 255) drop index 住户信息.入住2_FK go
if exists (select 1
from sysindexes
where id = object_id('周边设施') and name = '对应_FK' and indid > 0 and indid < 255) drop index 周边设施.对应_FK go
if exists (select 1
from sysindexes
where id = object_id('房间信息') and name = '入住_FK' and indid > 0 and indid < 255) drop index 房间信息.入住_FK go
if exists (select 1
from sysindexes
where id = object_id('房间信息') and name = '对应的_FK' and indid > 0 and indid < 255) drop index 房间信息.对应的_FK
11
物业管理系统
go
if exists (select 1
from sysindexes
where id = object_id('收费信息') and name = '收费_FK' and indid > 0 and indid < 255) drop index 收费信息.收费_FK go
if exists (select 1
from sysindexes
where id = object_id('楼宇信息') and name = '拥有的_FK' and indid > 0 and indid < 255) drop index 楼宇信息.拥有的_FK go
if exists (select 1
from sysindexes
where id = object_id('清洁管理') and name = '保洁_FK' and indid > 0 and indid < 255) drop index 清洁管理.保洁_FK go
if exists (select 1
from sysindexes
where id = object_id('维修') and name = '维修2_FK' and indid > 0 and indid < 255) drop index 维修.维修2_FK go
if exists (select 1
from sysindexes
where id = object_id('维修') and name = '维修_FK' and indid > 0 and indid < 255) drop index 维修.维修_FK go
if exists (select 1
from sysindexes
where id = object_id('设备信息') and name = '设备管理_FK' and indid > 0 and indid < 255) drop index 设备信息.设备管理_FK go
if exists (select 1
12
物业管理系统
from sysindexes
where id = object_id('车位') and name = '拥有_FK' and indid > 0 and indid < 255) drop index 车位.拥有_FK go
if exists (select 1
from sysobjects
where id = object_id('住户信息') and type = 'U') drop table 住户信息 go
if exists (select 1
from sysobjects
where id = object_id('周边设施') and type = 'U') drop table 周边设施 go
if exists (select 1
from sysobjects
where id = object_id('小区信息') and type = 'U') drop table 小区信息 go
if exists (select 1
from sysobjects
where id = object_id('房间信息') and type = 'U') drop table 房间信息 go
if exists (select 1
from sysobjects
where id = object_id('收费信息') and type = 'U') drop table 收费信息 go
if exists (select 1
from sysobjects
where id = object_id('楼宇信息') and type = 'U') drop table 楼宇信息 go
if exists (select 1
from sysobjects
where id = object_id('清洁管理') and type = 'U') drop table 清洁管理 go
if exists (select 1
13
物业管理系统
from sysobjects
where id = object_id('维修') and type = 'U') drop table 维修 go
if exists (select 1
from sysobjects
where id = object_id('设备信息') and type = 'U') drop table 设备信息 go
if exists (select 1
from sysobjects
where id = object_id('车位') and type = 'U') drop table 车位 go
/*==============================================================*/ /* Table: 住户信息 */ /*==============================================================*/ create table 住户信息 (
住户ID int not null, 房间ID int null, 姓名 char(256) null, 性别 bit null, 单位 char(256) null, 身份证号 int null, 联系电话 int null, 入住信息 bit null, constraint PK_住户信息 primary key nonclustered (住户ID) ) go
/*==============================================================*/ /* Index: 入住2_FK */ /*==============================================================*/ create index 入住2_FK on 住户信息 ( 房间ID ASC ) go
/*==============================================================*/ /* Table: 周边设施 */ /*==============================================================*/ create table 周边设施 (
周边设施ID int not null, 设施名称 char(256) not null, 小区ID image null, 负责人 char(256) null, 联系电话 int null, 备注 text null,
14
物业管理系统
constraint PK_周边设施 primary key nonclustered (周边设施ID, 设施名称) ) go
/*==============================================================*/ /* Index: 对应_FK */ /*==============================================================*/ create index 对应_FK on 周边设施 ( 小区ID ASC ) go
/*==============================================================*/ /* Table: 小区信息 */ /*==============================================================*/ create table 小区信息 (
小区ID image not null, 小区名 char(256) not null, 占地面积 float not null, 道路面积 float not null, 建筑面积 float null, 高层楼宇数量 int not null, 多层楼宇数量 int not null, 车位数量 int not null, 绿化面积 float null, 备注 text null, constraint PK_小区信息 primary key nonclustered (小区ID) ) go
/*==============================================================*/ /* Table: 房间信息 */ /*==============================================================*/ create table 房间信息 (
房间ID int not null, 住户ID int null, 楼宇ID int null, 单元 int null, 楼层 int null, 朝向 char(256) null, 房屋面积 float null, 业主姓名 char(256) null, 身份证号 int null, 联系电话 int null, 入住时间 datetime null, 备注 text null, constraint PK_房间信息 primary key nonclustered (房间ID) ) go
/*==============================================================*/ /* Index: 对应的_FK */ /*==============================================================*/
15