私は2つのテーブルを持っています:
create table [Customer]
(
[Id] int primary key identity not null,
[Type] int not null check([Type >= 0 and [Type] <= 2)
-- other columns
)
create table [Partial Record]
(
[Id] int primary key identity not null,
[Student Id] int references [Customer]([Id])
)
[Partial Record]
[Student Id] を呼び出したのは、Customer テーブルに継承があるためです。問題は次のとおりです。関連が学生のみに属していることを確認するためのチェックを"[Type] = 1"
追加[Partial Record]
したいと考えています。
出来ますか?