>>PMFJI but, you need to be careful when reading the PK in a separate call from the insert statement. @@IDENTITY returns the last inserted identity value. If several users are inserting records at the same time or several records are being added you may not get the right PK value.
>
>Are you sure this correct? I do not use Identity columns, but I thought the @@IDENTITY value was returned only for the current connection. In other words, INSERTs by other connections don't affect the value of the INSERT on my connection.
You're right. The multiuser case does not apply here. But inserting multiple records would be a problem.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only