数据库的SQL脚本代码.doc

上传人:大米 文档编号:555060385 上传时间:2023-09-19 格式:DOC 页数:4 大小:49.01KB
返回 下载 相关 举报
数据库的SQL脚本代码.doc_第1页
第1页 / 共4页
数据库的SQL脚本代码.doc_第2页
第2页 / 共4页
数据库的SQL脚本代码.doc_第3页
第3页 / 共4页
数据库的SQL脚本代码.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《数据库的SQL脚本代码.doc》由会员分享,可在线阅读,更多相关《数据库的SQL脚本代码.doc(4页珍藏版)》请在金锄头文库上搜索。

1、PowerDesigner设计的PDM模型生成数据库的SQL脚本(数据库名称为testDB),代码如下/*=*/* Database name: 流动人口管理系统PDM */* DBMS name: Microsoft SQL Server 2000 */* Created on: 2008-1-4 10:51:46 */*=*/if exists (select * from odb.sysdatabases where name=TestDB)drop database TestDBgocreate database TestDBgouse TestDBgoif exists (selec

2、t 1 from sysindexes where id = object_id(TenancyBargin) and name = HouseHost_Contract_FK and indid 0 and indid 0 and indid 0 and indid 255) drop index TenancyHouse.C_Tenancy_FKgoif exists (select 1 from sysobjects where id = object_id(HouseHost) and type = U) drop table HouseHostgoif exists (select

3、1 from sysobjects where id = object_id(PerMsg) and type = U) drop table PerMsggoif exists (select 1 from sysobjects where id = object_id(TenancyBargin) and type = U) drop table TenancyBargingoif exists (select 1 from sysobjects where id = object_id(TenancyHouse) and type = U) drop table TenancyHouse

4、goif exists (select 1 from sysobjects where id = object_id(managerTab) and type = U) drop table managerTabgo/*=*/* Table: HouseHost */*=*/create table HouseHost ( jID char(10) not null, jname char(10) null, jsex bit null, jbornday datetime null, tel char(50) null, constraint PK_HOUSEHOST primary key

5、 (jID)go/*=*/* Table: PerMsg */*=*/create table PerMsg ( yid char(18) not null, name char(8) null, sex bit null, born datetime null, position char(10) null, political char(10) null, stay text null, important char(20) null, studylevel char(20) null, salary char(20) null, socity text null, constraint

6、PK_PERMSG primary key (yid)go/*=*/* Table: TenancyBargin */*=*/create table TenancyBargin ( BarginID char(10) not null, yid char(18) not null, TenancyID char(10) not null, jID char(10) not null, BarginMoney numeric(10,2) null, StartTime datetime null, StopTime datetime null, constraint PK_TENANCYBARGIN primary key (BarginID)go/*=*/* Index: Person_Contract_FK */*=*/create index Person_Contract_FK on TenancyBargin (yid)go/*=*/* Index: HouseHost_Contract_FK */*=

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号