11,848
社区成员
发帖
与我相关
我的任务
分享
1、CREATE TABLE author ( ID bigint NOT NULL , AuthorName char(10) NULL , address char(480) NULL , introduction ntext NULL )
2、cREATE TABLE myBBS ( ID bigint IDENTITY (1, 1) NOT NULL , authorId bigint NOT NULL , Title char (40) NULL , Date_of_Created datetime NULL , Abstract char(480) NULL , Content ntext NULL )
--外键
Alter Table MyBBS Add Constraint FK_MyBBS_AuthorID Foreign Key(AuthorID) References Author(ID)
--删除约束
Alter Table MyBBS Drop Constraint FK_MyBBS_AuthorID
alter table author add constraint pk_1 primary key(id)
alter table myBBS add constraint fk_1 foreign key(authorId) references author(id)
alter table myBBS drop constraint fk_1