【SQL开源代码栏目提醒】:以下是网学会员为您推荐的SQL开源代码-EIP.sql,希望本篇文章对您学习有所帮助。
/*==============================================================*/
/* Database name: EIP */
/* DBMS name: Microsoft SQL Server 2000 */
/* Created on: 2006-6-22 16:57:49 */
/*==============================================================*/
alter table ACL
drop constraint FK_ACL_USERTOACL_USER
go
alter table BBS
drop constraint FK_BBS_USERTOBBS_USER
go
alter table Customer
drop constraint FK_CUSTOMER_USERTOCUS_USER
go
alter table News
drop constraint FK_NEWS_USERTONEW_USER
go
alter table Reply
drop constraint FK_REPLY_BBSTOREPL_BBS
go
if exists (select 1
from sysindexes
where id = object_id('ACL')
and name = 'UserToACL_FK'
and indid > 0
and indid < 255)
drop index ACL.UserToACL_FK
go
if exists (select 1
from sysindexes
where id = object_id('BBS')
and name = 'UserToBBS_FK'
and indid > 0
and indid < 255)
drop index BBS.UserToBBS_FK
go
if exists (select 1
from sysindexes
where id = object_id('Customer')
and name = 'UserToCustomer_FK'
and indid > 0
and indid < 255)
drop index Customer.UserToCustomer_FK
go
if exists (select 1
from sysindexes
where id = object_id('News')
and name = 'UserToNews_FK'
and indid > 0
and indid < 255)
drop index News.UserToNews_FK
go
if exists (select 1
from sysindexes
where id = object_id('Reply')
and name = 'BBSToReply_FK'
and indid > 0
and indid < 255)
drop index Reply.BBSToReply_FK
go
/*==============================================================*/
/* Table: ACL */
/*==============================================================*/
create table ACL (
UserID varchar(100) not null,
ACLID varchar(100) not null,
ModName varchar(100) null,
constraint PK_ACL primary key (UserID, ACLID)
)
go
/*==============================================================*/
/* Index: UserToACL_FK */
/*==============================================================*/
create index UserToACL_FK on ACL (
UserID
)
go
/*==============================================================*/
/* Table: BBS */
/*==============================================================*/
create table BBS (
BBSID int not null,
UserID varchar(100) not null,
Title varchar(100) not null,
Content text null,
AddinTime datetime null,
replyCount int null,
constraint PK_BBS primary key (BBSID)
)
go
/*==============================================================*/
/* Index: UserToBBS_FK */
/*==============================================================*/
create index UserToBBS_FK on BBS (
UserID
)
go
/*==============================================================*/
/* Table: Customer */
/*==============================================================*/
create table Customer (
CustomerID varchar(100) not null,
UserID varchar(100) not null,
DepartName varchar(100) null,
CustType varchar(100) null,
BussType varchar(100) null,
Address varchar(100) not null,
Postalcode varchar(100) null,
Remark text null,
constraint PK_CUSTOMER primary key (CustomerID)
)
go
/*==============================================================*/
/* Index: UserToCustomer_FK */
/*==============================================================*/
create index UserToCustomer_FK on Customer (
UserID
)
go
/*==============================================================*/
/* Table: News */
/*==============================================================*/
create table News (
NewsID int not null,
UserID varchar(100) not null,
NewsTitle varchar(100) not null,
Content text null,
AddinTime datetime null,
ReadCount int null,
constraint PK_NEWS primary key (NewsID)
)
go
/*==============================================================*/
/* Index: UserToNews_FK */
/*==============================================================*/
create index UserToNews_FK on News (
UserID
)
go
/*==============================================================*/
/* Table: Product */
/*==============================================================*/
create table Product (
ProductID varchar(100) not null,
ProductType varchar(100) null,
OutofFacTime datetime null,
ProdcutName varchar(100) not null,
Price money null,
isNew int null,
constraint PK_PRODUCT primary key (ProductID)
)
go
/*==============================================================*/
/* Table: Reply */
/*==============================================================*/
create table Reply (
ReplyID int