looping through records of a view
Posted on 2006-12-01
I'm familiar with how to loop through records in .net using a recordset but how do I do it in SQL.
I have a view with a bunch of records. each record must be inserted into another DB (mdb), but each record needs to be tested before it is added to the mdb.
here's my seudo VB code example:
while view not EOF
if view!name = null then
Add_Customer view!name (a function that adds the new customer to the mdb with the name field as a param)
insert into tblInvoices (name, amopunt, taxes, so on) .......
How would I replicate this logic in a SQL proc