>Table A holds parent records.
>Table B has children.
>
>At specified invervals controlled by the user (button click), portions of table A need to be copied to table B (as in a batch posting routine).
>In VFP I would select the records from table A into a cursor and scan through it doing an insert into table B. Even with sql back end.
>
>Now what do I use for a cursor and scan loop?
>
>Do I construct a sql statement that performs an insert from a select as a stored procedure?
>
>Any help is appreciated. Type slow though I'm sorta dense.
If you need to process each record, I'd follow Bonnie's suggestion (although if you're using MM.NET, I'd probably iterate through the Entity collection instead).
If you don't need to mess to much with the records, I'd just do this in SQL (you can do this in a Stored Proc, or just pass the SQL as-is through your business object.
INSERT INTO SomeTable (field 1, field 2) SELECT field1, field2 FROM SomeOtherTable