Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLServer- Identifier/ AutoInc value and CA
Message
De
02/06/2007 09:06:01
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Divers
Thread ID:
01229802
Message ID:
01229944
Vues:
12
>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
Fil
Voir

Click here to load this message in the networking platform