I don't see anything in here that will prevent you from creating a SP and performing this action for all rows. You may have to add more code though, to prevent INSERTs from occuring for rows that have already been INSERTed, to avoid any duplicate rows issues.