Information générale
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
>I don't think you should use IDENT_CURRENT in multi-user application. How can you guarantee it's the last record added by this user?
It's not failsafe, but quite, as the InsertRefreshCmd is executes right after the insert. And it's better than uising @@IDENTITY.
You are right, in that IDENT_CURRENT() could return an ID from a record inserted afterwards by another user, as it's scoped to the table, not to a connection.
SCOPE_IDENTITY() might be better, especially if you don't share a connection, but if you share connections I'd rather rely on IDENT_CURRENT().
Bye, Olaf.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement