>>OK Naomi,
>>But I nowehere said Autoinc or Identity:) Simple updatable int field. Use mine if supplied or assign automatically if not. ie:
>>
>>
>>lnID = NextID('MyTable', 1)
>>* ...
>>insert into myTable (myPK) values (m.lnID)
>>* I may choose to not insert anything and waste the key
>>
>>Or let backend do it:
>>
>>insert into myTable (aFieldOtherThanPk) values ('something')
>>lnID = myTable.PK
>>
>>
>>Wish it was done with GUIDs from the start.
>>
>>Cetin
>>
>
>I see. I guess me and Borislav automatically assumed you were talking about Identity field.
>
>So, what exactly is the problem - get the ID after it was calculated by default or get it using the same function but without an actual insert?
Yes, I want to have it both as a default value when not passed during an insert or get it using the same SP w/o an actual insert (insert may take place later or not, and if later it might already have assigned that value as foreign key to some child tables as well).
Cetin