I found this great article, http://www.singingeels.com/Articles/Understanding_SQL_Many_to_Many_Relationships.aspx, and really helps me a lot. But there's a method that I don't know how to do especially that i find myself still a newbie.

From the said article, there's a method that " the customer service rep would enter a record into the Tickets table and the system would insert a link (the ID of the phone call and the ID of the ticket) into the linker table".

How can I add the two primary keys from two tables into another table, which is a linker table.

Using an "INSERT INTO LinkerTable VALUES (IdFromTable1, IdFromTable2)" sentence to execute an SQLCommand against the database.

In your example, this linktable relates one ticket for one call. The assumption is that one Ticket can have many(m) calls and also a call can refer to many(n) tickets. In this case, you should enter then records in the linkt table to describe each ticket-call relation. Avoid duplicates.

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.