Thank you very much. I am planning to use different databases so I will have to use the specific dialect, but knowing that something like that exists makes all the difference. I will execte the INSERT and SELECT SELECT @@IDENTITY AS NewID in the same statement to make it
thread safe.
If you could tell me how to do it for other databases, that would save me a lot of time.