Relationships in SQL 7

Results 1 to 2 of 2

Thread: Relationships in SQL 7

  1. #1
    Join Date
    Dec 1969

    Default Relationships in SQL 7

    Hi,<BR>How do I create a relationship in a SQL 7 database between two fields in two different tables but in the same database. <BR><BR>This is simple in Access but been new to SQL I haven&#039t been able to find an answer easily. <BR>I just want to have two tables with one table showing a list of countries for example and that list would be under a field called CountryName and maybe an ID field as well. The other table would be a list of people ie Name, Phone etc and it would have one look up field called Country which would have an option to select only from the CountryName in the Country Table.<BR><BR>It would be really good if you could guide me on how to do this.<BR><BR>aj

  2. #2
    Join Date
    Dec 1969

    Default RE: Relationships in SQL 7

    I don&#039t have SQL Server at work but when I set up my relationships at home, I know I struggled for a bit. Anyway, if I remember correctly, create a new diagram or open your existing diagram and add the tables in question. Next right click the country column and set that as your primary key. The other table should already have a column named country. Now click the country field in the first table and drag it over to the second table. I think you are done. You may have to set the properties of the second table&#039s country column to be a foreign key.<BR><BR>HTH,<BR><BR>Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts