Justin Cave's solution is easy to achieve, but there is one problem. These are my steps should be:
1. Disable trigger 2. Get 5000 Ids from sequences 3. Assign Ids to records 4. Execute bulk insert into database 5. Enable trigger
If the user is in step 2 (or 3, 4), he disabled the trigger. And another user in a different context also inserts a record into my table at that time, so that he cannot get the increased id;
Mark Gravellโs decision seems very pleasant. But itโs hard for me to achieve. My project uses Entity Framework. You mean: with each table in the database, I have to create another table with the same structure?
source share