Bob Schneider
asked on
Join two tables in sql server 2008
I just created a new table and I want to join it to an existing table using the Primary key in the original table as a foreign key in the new table. In sql server 2000I did this via a diagram. I don't have diagrams here. How can I complete this task otherwise?
Thanks!
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this is a sql statement to do the foreign key:
CREATE TABLE STOCK
(Stock_ID integer primary key,
StockIn_Date datetime,
Description char(100),
Supplier_SID integer references SUPPLIER(SID),
Amount double);
CREATE TABLE STOCK
(Stock_ID integer primary key,
StockIn_Date datetime,
Description char(100),
Supplier_SID integer references SUPPLIER(SID),
Amount double);
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome. Thanks!
ASKER