Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IDENT_CURRENT() and VFP Remote view
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
IDENT_CURRENT() and VFP Remote view
Miscellaneous
Thread ID:
01029044
Message ID:
01029044
Views:
137
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?
Next
Reply
Map
View

Click here to load this message in the networking platform