I am working on a project and need to create 100000000 records and they have a small data footprint, just 4 columns, 3 uniqueidentifiers, 1 int. 2 of the identifiers need to be read from other tables, and then used in the other table. So for example
TableA has a column taid uniqueidentifier (about 20000 records)
TableB has a column tbid uniqueidentifer (about 5000 records)
I need a row in TableC for every row in TableA and TableB, that will look like this:
taid tbid tcid int
Is it possible to a stored procedure to retrieve the ids from TableA and TableB, store in arrays or something, and then do loops to create TableC?