在企业管理器的表设计里可以创建,如果想看代码,导出脚本,看看就行了:)

解决方案 »

  1.   

    例如:
    create table test4
    (
    pub_id varchar(20) primary key,
    pub_name varchar(50),
    address varchar(20),
    city varchar(10),
    state char(10),
    country char(10)
    )
    GO
    create table test5
    (
    author_id varchar(20) primary key,
    author_name varchar(50),
    phone varchar(20),
    zipcode char(10)
    )
    gocreate table test6
    (
    title_id int primary key,
    title_name varchar(20),
    author_id varchar(20),
    constraint foreignkey_auid foreign key (author_id) references test5(author_id),pub_id varchar(20),
    constraint foreignkey_pubid foreign key (pub_id) references test4(pub_id),)
    go