многостолбцовые внешние ключи
Мои таблицы:
1)
CREATE TABLE [dbo].[VS_TER] (
[Kod_Term] [int] NOT NULL ,
[Date_Add] [datetime] NULL ,
[UdateOfName] [datetime] NULL ,
[Kod_S] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VS_TER] ADD
CONSTRAINT [PK_VS_TER] PRIMARY KEY CLUSTERED
(
[Kod_Term]
) ON [PRIMARY]
GO
2)
CREATE TABLE [dbo].[VS_TER_INDEX] (
[Kod_D] [int] NOT NULL ,
[Kod_Term] [int] NOT NULL ,
[id] [int] IDENTITY (1, 1) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VS_TER_INDEX] ADD
CONSTRAINT [PK_VS_TER_INDEX] PRIMARY KEY CLUSTERED
(
[id]
) ON [PRIMARY]
GO
Хочу поля Kod_D и Kod_Term таблицы VS_TER_INDEX сделать внешним ключом
А поле Kod_Term таблицы VS_TER - родительский ключ