/*==============================================================*/
/* DBMS name: Microsoft SQL Server 2005 */
/* Created on: 2017/1/2 14:56:12 */
/*==============================================================*/
if exists (select 1
from sysobjects
where id = object_id('Kehu')
and type = 'TR')
drop trigger Kehu
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('kefang') and o.name = 'FK_KEFANG_REFERENCE_ROOMSTAT')
alter table kefang
drop constraint FK_KEFANG_REFERENCE_ROOMSTAT
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('kefang') and o.name = 'FK_KEFANG_REFERENCE_ROOMTYPE')
alter table kefang
drop constraint FK_KEFANG_REFERENCE_ROOMTYPE
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('kehu') and o.name = 'FK_KEHU_REFERENCE_KEFANG')
alter table kehu
drop constraint FK_KEHU_REFERENCE_KEFANG
go
if exists (select 1
from sysobjects
where id = object_id('RoomState')
and type = 'U')
drop table RoomState
go
if exists (select 1
from sysobjects
where id = object_id('RoomType')
and type = 'U')
drop table RoomType
go
if exists (select 1
from sysobjects
where id = object_id('kefang')
and type = 'U')
drop table kefang
go
if exists (select 1
from sysobjects
where id = object_id('kehu')
and type = 'U')
drop table kehu
go
/*==============================================================*/
/* Table: RoomState */
/*==============================================================*/
create table RoomState (
RoomStateID int not null,
RoomStateName varchar(10) null,
constraint PK_ROOMSTATE primary key (RoomStateID)
)
go
/*=====================================
酒店管理.sql
最新推荐文章于 2022-02-24 08:41:46 发布