I often see references to system information such as
I often see it being used in a way that might not seem completely accurate.
For example, after an Insert operation, you might fetch identity:
Declare @NewlyAddedId int
@NewlyAddedId = @@Identity
Is this guaranteed to get the right answer?
Because several users can be running scripts at the same time. Who can guarantee that no-one else did an insert operation at about the same time that you did an insert operation?
Or does @@Identity return the identity of the most recently added id that was added by the current script or procedure. I don't think that is the case, and hence the usage of @@identity and other such system information is a bit bothersome....