我有两张桌子:
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])
)
我之所以调用 [Student Id],是因为 Customer 表具有继承性,问题是:我想添加一个检查[Partial Record]
以确保关联具有仅属于学生的"[Type] = 1"
for 。[Partial Record]
是否可以?