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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with table/relationship 1

Status
Not open for further replies.

manjeetsimone

IS-IT--Management
Jun 17, 2001
5
AU
Hi there

Can someone please tell me how to over come this problem:

Table Doc : contains information about Doctor's and the primary key is Doc_ID

Table Hospital : contains information about the Hospital and the primary key is Hos_ID

One Doctor can belong to many Hospitals and One Hospital can have many Doctors. So I believe this is many to many relationship.

I created a junction table called Doc_Hos table which contains Doc_ID and Hos_ID, my problem is when I create a new Doc_ID and/or a new Hoc_ID the junction table is not updated.

Can someone please tell me how to overcome this.

Thank you
 
When you add a doctor, how can you tell which hospital(s) he belongs to? When you add a hospital, how can you tell which doctors belong? You really have to insert the junction table rows explicitly. SQL Server cannot automatically do this for you.
Terry

The reason why worry kills more people than work is that more people worry than work. - Robert Frost
 
Pardon my error. Rather than stating, "SQL Server cannot automatically do this for you" It should "Access cannot automatically do this for you." Terry

The reason why worry kills more people than work is that more people worry than work. - Robert Frost
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top