|
"Birgitta Hauser" <Hauser@xxxxxxxxxxxxxxx>process is
01-12-2015 07:09
AW: Identity column
Could using option 1 yield an incorrect result if more than one
adding records to the table simultaneously?insert
IDENTITY_VAL_LOCAL will return the identity value of the most recent
on the same level. An insert in a different job is or activation groupis
performed on a different level. Even a trigger or a different programor a
procedure activated in the same job/activation group is considered to beon
a different level.immediately
BTW it also works correctly, if the record gets written with native I/O.
In either way the IDENTITY_VAL_LOCAL function should be executed
after the insert/write operation for a single row.of
From the SQL Reference - Release 7.2:
The value returned is the value that was assigned to the identity column
the table identified in the most recent insert operation (specified invalue
either an INSERT statement or a MERGE statement).
The insert operation has to be issued at the same level; that is, the
has to be available locally within the level at which it was assigneduntil
replaced by the next assigned value.is
A new level is initiated when a trigger, function, or stored procedure
invoked. A trigger condition is at the same level as the associated(Les
triggered action.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars."
Brown)them
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
and keeping them!"
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.