I have two tables:
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])
)
I called [Student Id] because the Customer table has a inheritance, here's the problem:
I want to add a check [Partial Record]
to make sure that the association has a "[Type] = 1"
for [Partial Record]
belongs only to students.
is it possible?