Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IDENT_CURRENT() and VFP Remote view
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
IDENT_CURRENT() and VFP Remote view
Divers
Thread ID:
01029044
Message ID:
01029044
Vues:
134
I have a remote view in VFP's DBC that is binding with SQL Server table called "myTable" with two fields: "nCode" that is identity type in SQL server and "cName" type varchar

If I want to know the value of nCode field after to do an INSERT, I use the function IDENT_CURRENT ( )

The procedure is:
use myRemoteView
append blank
replace cName with "something"
tableupdate(.t.)

SQLEXEC( nHandle,"select IDENT_CURRENT('myTable') AS nValue","cur_identity")
SELECT cur_identity
nValueOfCode = cur_identity.nValue
This far everything works well, but the problem is that several users make INSERT in the SQL's Server table "myTable" and between time difference to do a TABLEUPDATE ( ) and to call IDENT _CURRENT ( ) another user already made an INSERT and return different value of "nCode" That I already had generated

How can I do, than once I made the TABLERUPDATE to know the value that "IDENTITY" generate, rather than another user do an INSERT in the middle?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform