Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Linking two primary keys from Products table to SalesDetail table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-03 : 08:03:28
Henry writes "How to link two primary keys from Products table to SalesDetail table? Please let me know if there's a way I can do that in T-SQL. Thank you."

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-03 : 08:16:38
are you referring to joins?

select ....
from products p
join salesdetail s
on p.key=s.key

quote:
Originally posted by AskSQLTeam

Henry writes "How to link two primary keys from Products table to SalesDetail table? Please let me know if there's a way I can do that in T-SQL. Thank you."



--------------------
keeping it simple...
Go to Top of Page

dsdeming

479 Posts

Posted - 2004-12-03 : 08:27:26
Are you talking about establishing a foreign key between the two tables? If so, take a look at ALTER TABLE in BOL.

Dennis
Go to Top of Page
   

- Advertisement -