阅读背景:

如果我使用的是FK,那么使用int而不是char或nvarchar是否有意义呢?

来源:互联网 

I have something like this:

我有这样的东西:

    create table account
    (
       id int identity(1,1) primary key,
       usertype char(1) check(usertype in ('a', 'b')) not null, 
       unique(id, usertype)
    )

    create table auser
    (
       id int primary key,
       usertype char(1) check(usertype = 'a') not null, 
       foreign key (id, usertype) references account(id, usertype)
    )

    create table buser
    (
    ... same just with b
    )
    cr



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: