On a routine basis, I need to copy upwards of 10,000 records matching certain criteria from one table to three others. My concern is that users could insert rows matching the criteria during one of the operations - causing the subsequent operations to copy a different number of records.
Right now I do a SELECT INTO to put the primary keys of the records to copy into a temp table and then perform the copy operation for each destination table by joining the temp table to the source table, but like I said, there can be upwards of 10,000 records. I don't know if creating a temp table that big is a good idea - even if it only holds primary keys.
What other options are there? Thanks!
Adam
Right now I do a SELECT INTO to put the primary keys of the records to copy into a temp table and then perform the copy operation for each destination table by joining the temp table to the source table, but like I said, there can be upwards of 10,000 records. I don't know if creating a temp table that big is a good idea - even if it only holds primary keys.
What other options are there? Thanks!
Adam