Quality Check Task, Adding Tables and Relationships

Let us go to the Tables tab. In the Tables tab we define relations between tables by adding these in the left-hand column.

mceclip0.png

Primary key tables are added first, and foreign key tables are added as relations to the primary key tables.

mceclip1.png

Right-click to add the Item table here. Once added, select No_ as the Primary Key column.

mceclip2.png

Next we will add a related table to the Item table.

mceclip3.png

The related table we want to add is the Sales Invoice Line table. And furthermore we will need to point out the Foreign Key column of this table. The Foreign Key of the Sales Invoice Line table is also called No_. However, do not assume that you always have a one-to-one name match on foreign keys versus primary keys. If in doubt, look up the relation from your Data Source View.

mceclip4.png

If we click the Show SQL button we will be able to see the resulting SQL script from what we have done so far.

mceclip5.png

In plain text, the SQL script would read something like this:

Check that all item numbers in the Sales Invoice Line table (the foreign keys) exists in the Item table (the primary keys). If an Item number in the Sales Invoice Line table is found to be missing in the Item table, insert it into the Item table.

If we do something similar for all known table relations, we will in other words obtain full data integrity: All foreign keys will have matching primary keys.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.