Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLServer- Identifier/ AutoInc value and CA
Message
From
02/06/2007 09:06:01
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01229802
Message ID:
01229944
Views:
19
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform