since I am doing a lot of SQL and SP for creating rows in tables, let me tell you some of the techniques I have used
and remember:
does NOT matter what the ID # in a table is, as long as it is unique
does not matter if 2 diff. BOs have the same ID field.
Technique 1
Start a transaction
get ID from BAS_IDGEN
after done adding rows, get count of them
Update ID with # of rows added
Update BAS_IDGEN
now, while adding the rows, I use the ROW_NUMBER() function in MSSQL so my insert looks like
INSERT INTO XXX (ID ....)
SELECT @ID + Row_Number() (order by xxxx) .....
this will give me a sequential #
Technique 2, for when others are adding and I want to let them do their "thing"
Add a numeric field to my BO that is not used for anything in Aware
Change it to an identity field in SQL with the SEED set to a large #, above what the ID will ever get to
Create an AFTER INSERT trigger that checks if ID is NULL and if so, assigns identity field to ID
this way, dont have to worry about BAS_ID
Technique 3, when I am inserting records from other tables, they might have a unique key, and if I know its not going to meet the ID fields in Aware, will just use that. Many times my Aware BOs are at the end of the food chain, after other table have been created.
and, when all else fails, you can always reset the ID # if you really screw up (which I have done more than once.), however, I do find I have to restart aware when I do that...
Bruce