Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary Key to Primary Key relationship
Message
From
04/01/2001 16:27:07
 
 
To
04/01/2001 15:56:27
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00459550
Message ID:
00459567
Views:
22
>The documentation seems to say that I can set a 1 to 1 relationship between tables with the command "Alter Table table1 references table2". However this gives me a syntax error, as does "alter table table1 references table2 tag mytag". Can anyone tell me what the syntax of the command to establish a 1 to 1 relationship between 2 tables with primary keys in a DBC? Thanks.

The References keyword seems to only work with a Foreign Key clause, however, since mytag is already the primary key, it will simply add the reference and not overwrite the tag or create another one. This should work (at least, it did for me):
Alter Table table1 Add Foreign Key Tag mytag References table2 Tag mytag
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform