Is there a simple method to loop through a table in SQL ?
I am trying to write a stored procedure that takes some field values from a table row and uses them as passed variables in a stored procedure.
I can step through a record set easily using a front end application like access but I want to do this completely in SQL for the time being.
Example:
TestTable contains 3 fields:
ValidationFlag
Criteria
Portfolio
There might be 5 records in there with the same portfolio value and so I would want to call the stored procedure 5 times, each time passing back the different ValidationFLag and Criteria field for that row.
Is this a simple thing to do in SQL ?
Thanks
I am trying to write a stored procedure that takes some field values from a table row and uses them as passed variables in a stored procedure.
I can step through a record set easily using a front end application like access but I want to do this completely in SQL for the time being.
Example:
TestTable contains 3 fields:
ValidationFlag
Criteria
Portfolio
There might be 5 records in there with the same portfolio value and so I would want to call the stored procedure 5 times, each time passing back the different ValidationFLag and Criteria field for that row.
Is this a simple thing to do in SQL ?
Thanks