Insert thousands of many to many links to the DB quickly
<p>I am working on a project where I have the following scenario:</p>

<p>Sales-rep A may deal with customers x, y and z for products 1, 2 and 3
Sales-rep B may deal with customers w, y and z for product 1, 5 and 6</p>

<p>to deal with the above I have the following table structures:</p>

<p>SalesReps: a table with the detail of each sales rep uniquely identified by SRID
Products: a table with all the products with unique key PRID
Customers: a tabel with customer details with unique key CID</p>

<p>Finally I link them with a table </p>

<p>RepProductCustomer: with columns SRID, PRID and CID</p>

<p>It all works fine generally but when dealing with a company which has a lot of products and customers and sales-reps the number of rows gets really large and take very long to add using Entity Framework.</p>

<p>What's the most efficient way to add these entries? Can I use some sort of stored procedure or SQL command to speed this up? I have tried various EF optimisations, but there is just too much data to be inserted on some occasions and the user has to wait for a very long time for the request to complete.</p>

<p>Any help would be appreciated.</p>