Check out the BOL. If we understand you correctly, you need to create a primary key in one table and make a foreign key in the second table that matches the PK.
Table 1
LName
FName
EmpID PK
Table 2
DeptID PK
EmpID FK
Then you would JOIN the tables by the EmpID. However, they don't need to have the same names, just the same value:
Table 1
LName
FName
Phone PK
Table 2
CompanyName PK
ContactNumber FK
-SQLBill
BOL=Books OnLine=Microsoft SQL Server's HELP
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine
or online at:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.