I want to know what's the suitable method to implement the following case (best practice).
If i make a set of processes like this:
select data from set of DB tables.
loop on the selected result.
Make some checks on each iteration.
Insert the result in another table.
Implementing the previous steps in a stored procedure or in a transaction through my code (asp.net)? Concerning the performance, security and reliability issues.