酒店管理.sql
2017-01-02 16:09
351 查看
/*==============================================================*/ /* 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
- ORACLE数据库的导入及导出
- 清除缓存,计算Sql Server查询效率
- SQL 查询异常
- PLSQL:[1]plsql中文乱码,显示问号
- oracle 列转行
- 优化MYSCOOL第一章 数据库的设计 知识点 上机 简答
- Redis之String类型
- SQL语句错误
- 连接远程数据库错误2003的解决办法
- Mongodb 3.2 官方 启用认证
- mysql 擎特点
- 数据库的影响(一) 4000
- MySQL的事务隔离级别
- 酒店管理系统的E-R图和数据库模型图
- 非关系型数据库(NoSql)
- mongoDB入门一
- 通过PreparedStatement 对数据库进行增删改查
- S2 数据库的实现 第一章
- SQL基础--完整性约束