Also I need to make sure that both work on the same records, in perfect world in the time it takes to carry out both actions no users will edit data.
Example, the query will only work on the records that have a email value set, if the insert into runs past a record and a user updates a record to include a email address before the update has ran there will be an issue, chances are small but I rather not run into that problem if I dont have to,
Should I:
Use a transaction?
Find someway of locking that table?(no clue there)