Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I still cannot define a one-to-one relationship in SQL Server 7

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have checked, according to Robert Bradley's tip, that Table1's foreign key does not allow null values, and refers to Table2's primary key. Still SQL Server 7 sets my join-type to a one-to-many relationship.<br>The two fields that I am trying to relate are of the type nvarchar.<br>In Access97 this join type is a one-to-one relation.<br>I really appreciate any help you can give me to solve this problem.<br>-Jonas
 
Set a unique constraint on both columns. If either of the columns are a primary key, then that is enough for that column. What I would do next is the create a unique index on the second column. This should enforce a one to one relationship between the tables <p>Cal<br><a href=mailto: > </a><br><a href= > </a><br>
 
Thanks Cal!<br><br>I have now managed to make a one-to-one relationship :) How great!<br><br>As one of my columns is a primarykey, I only created an index for the seond column and then it automaticially changed to a 1-to-1 relationship.<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top