Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's how - it's slightly difficult to explain in text only, but I'll give it a shot:</p> <p>Define the employee, office and job title tables in your database with an identity column, so that IDs will be generated automatically.</p> <p>Define the many-to-many tables without (identity is not needed or useful)</p> <p>In your SSIS data flow, you have to do this in a couple of passes, in order to establish the IDs in the database first, then come back and insert the many-to-many rows.</p> <p>Make one data flow:</p> <ol> <li>Put a data source to read in the file</li> <li>Split it into three copies with a Multi-Cast. One will be for employees, one offices, one titles.</li> <li>For each, put a Sort (this is generally a no-no, but since the source is text and not a database, we have to go there). Set the sort to pass through only one of the three fields, and check the option in the sort to remove duplicates. This makes a unique list (like select distinct) for each base table.</li> <li>Put a destination for each of the three, connected to each table.</li> </ol> <p>After the first data flow, add a second data flow. This one will populate the many-to-many relation rows</p> <ol> <li>Read the file with a data source</li> <li>Add a lookup that finds for Employee Name in the database and returns the Employee ID. That gets you the Employee ID that was generated above. (this is usually called lookup by business or natural key for surrogate key)</li> <li>Add a lookup that finds for Title in the database and returns the Title ID</li> <li>Add a lookup that finds for Office in the database and returns the Office ID</li> <li>Again, multi-cast the results into two copies, one for employee-office and one for employee-title</li> <li>Depending on the logic you need, perhaps use Sort, again, to deduplicate these (depends on the detail of how you are normalizing from the input)</li> <li>Put the results into the many-to-many tables with two destinations.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload