>>append ....
>>replace sp_id with recno() - m.nOldReccount + aMaxPK[1,1] ;
>> for sp_id = 0If you use SRACCGPK(0) you should go to data builder and update 0 with new last PK (that's sp_id of last appended record). If you use -1 then you don't need to do any update.
>>Cetin
>
>Thanks for trying to help David and Cetin,
>
>Cetin, I think I will go with the sraccgpk(-1) for the time being and the will also generate the pk's manually because some of the tables I'm appending are in the 200,000 records range, so an "append all from..." and then "replace all" seems much faster than looping through all the records (especially because since they're not normalized, I will have to go through this a couple of times for each of the tables.
>
>Alex
Alex,
Then also take faster route for setting SRACCGPK(-1). Instead of using data builder :
use SRACDD2
replace primary with "SRCACGPK(-1)" for primary = "SRCACGPK("
I might have forgotten the "primary" field name in DD2 so pls check first.
Also take a note of what you're affecting when you do manual replacing by checking table relations report. If tables do not somehow have childs yet than there might be no problem if you don't check (otherwise you're breakig referential integrity).
Cetin