酒店管理.sql

来源:互联网 发布:linux dsdt 编辑:程序博客网 时间:2024/04/27 21:32
/*==============================================================*//* 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 Kehugoif 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_ROOMSTATgoif 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_ROOMTYPEgoif 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_KEFANGgoif exists (select 1            from  sysobjects           where  id = object_id('RoomState')            and   type = 'U')   drop table RoomStategoif exists (select 1            from  sysobjects           where  id = object_id('RoomType')            and   type = 'U')   drop table RoomTypegoif exists (select 1            from  sysobjects           where  id = object_id('kefang')            and   type = 'U')   drop table kefanggoif exists (select 1            from  sysobjects           where  id = object_id('kehu')            and   type = 'U')   drop table kehugo/*==============================================================*//* Table: RoomState                                             *//*==============================================================*/create table RoomState (   RoomStateID          int                  not null,   RoomStateName        varchar(10)          null,   constraint PK_ROOMSTATE primary key (RoomStateID))go/*=====================================

0 0