I want to write a stored procedure to loop through set of records and for each of the record execute another stored procedure.
Select query returning list of id's:
select id
from abc
where some condition
I have a stored procedure usp_get_data @id=id
which I want to execute for each of the rows of the select query. I do not want to use cursor. What are the other ways I can achieve this?
foreach(item in select statement)
{
execute stored procedure
}
The sub stored procedure will return a list of records which I will then return back from the main stored procedure