Dimnn
Дата: 15.09.2006 13:46:57
MSSQL 2005
Проблема в следующем, создаю внешний ключ, код ниже
ALTER TABLE [dbo].[t_bill]
ADD CONSTRAINT [$3t_bill]
FOREIGN KEY([id_reserve], [id_pos])
REFERENCES [dbo].[t_reserve]([id_reserve], [id_pos])
ON DELETE NO ACTION
ON UPDATE NO ACTION
Сервер ругаеться на отсутствие первичного ключа в таблице t_reserve
There are no primary or candidate keys in the referenced table 'dbo.t_reserve' that match the referencing column list in the foreign key '$3t_bill'
Но он там есть
ALTER TABLE dbo.t_reserve
ADD CONSTRAINT t_reserve_pkey
PRIMARY KEY (id_pos, id_reserve)
GO
Помогите юному осваивателю SQL server а:)