Temporary Tables

I am thinking about employing some temporary tables in a Codeunit I am using to create batches of Sales Headers and Sales Lines. I am considering this in order to improve performance and prevent other users from feeling a performance hit while the process is running. My questions are: The temp tables are created on the client? Even though they are temp tables, all the triggers, events, etc. still apply? What is the best method for moving the records to the permanent tables in order to avoid re-running all of the code you ran while inserting into the temp tables? In other words just brute force push all the records to the permanent table because you have already validated your data in the temp objects. Thanks

Do you understand that your temp table is gone the moment your codeunit finishes… Temp tables are slow if you don’t resize the client dbms cache

1.) Temp tables are createf on client 2.) All triggers are available , BUT the use of keys is depending on your navision version 3.) Brute force push is NO good solution because : What do you do if in the meantime in your permanent table any user has inserted a record? The Primary key of your temp-table record may not be valid in this case ! Changing of PrimaryKeyFields may conflict with your already validated data. So you have a lot of thinking for transfering the data from temp to permanent.