• A cursor is not the right approach for this scenario. Allthough it is not very clear what your situation is, it sounds like you can just insert the results from two tables joind together into a new table.

    Table_A holds the company, plant, part, etc. values

    Table_B holds the 'from part', 'to part', and maybe some more relevant columns

    The query would look like this:

    SELECT {specify the required columns here}

    INTO {new_table}

    FROM Table_A

    INNER JOIN Table_B

    ON Table_A.part = Table_B.from_part

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **