Does @@ IDENTITY include a race condition in triggers in SP?

If I used @@IDENTITYsp in SQL, which also activated the trigger, would this lead to a race condition?

Let's say I execute INSERT INTO TABLE_A, which launches INSERT INTO TABLE_B, and then in the current area I use@@IDENTITY

Will I always get the resulting identifier from trigger ( TABLE_B) or will it depend on which thread finished first?

Note: I know about SCOPE_IDENTITY, this question is hypothetical ....

+3
source share
1 answer

, B, A ( T-SQL ), , AFTER, , , @@.

+2

Source: https://habr.com/ru/post/1784612/


All Articles