Hi, Zufie.
I want to specifying a foreign key by altering a table.
Try:
ALTER TABLE ORDERS
ADD CONSTRAINT ORDERS_CUSTOMER_FK
FOREIGN KEY (Customer_SID)
REFERENCES CUSTOMER (SID);
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs:
www.DataDevilDog.BlogSpot.com,
www.DatabaseTips.BlogSpot.com http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"zufie" <jo***********@illinois.govwrote in message
news:11*********************@r56g2000hsd.googlegro ups.com...
Hi,
I want to specifying a foreign key by altering a table.
First, I create an ORDERS table without specifying a foreign key. Here
is my code:
CREATE TABLE ORDERS
(Order_ID integer,
Order_Date date,
Customer_SID integer,
Amount double,
Primary Key (Order_ID));
Next, I specify a foreign key by altering a table. Here is my code:
ALTER TABLE ORDERS
ADD FOREIGN KEY (customer_sid) REFERENCES CUSTOMER(SID);
What can I do to make this code work with MS Access?
Thanks for your help!!!!!!!!
Zufie