Ö
Özden Irmak
Hello,
I'm trying to establish a one to one relation via code in 2 tables. Both
tables contains one primary key columns and with the following code I can
create one to many relationship :
ALTER TABLE [Tabel2] ADD CONSTRAINT [Tabel1Tabel2] FOREIGN KEY [Veld1]
REFERENCES [Tabel1] ([Veld1]);
I think that it should be something like that but it doesn't work and gives
syntax error :
ALTER TABLE [Tabel2] ADD CONSTRAINT [Tabel1Tabel2] UNIQUE [Veld1] REFERENCES
[Tabel1] ([Veld1]);
Thanks in advance...
Özden
I'm trying to establish a one to one relation via code in 2 tables. Both
tables contains one primary key columns and with the following code I can
create one to many relationship :
ALTER TABLE [Tabel2] ADD CONSTRAINT [Tabel1Tabel2] FOREIGN KEY [Veld1]
REFERENCES [Tabel1] ([Veld1]);
I think that it should be something like that but it doesn't work and gives
syntax error :
ALTER TABLE [Tabel2] ADD CONSTRAINT [Tabel1Tabel2] UNIQUE [Veld1] REFERENCES
[Tabel1] ([Veld1]);
Thanks in advance...
Özden