Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Determine SQL ID
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01092510
Message ID:
01092922
Views:
21
Oh, I see. That would be bad.

Thanks!




>Hi Kevin,
>
>I intentionally omitted IDENT_CURRENT because in multi-user environment it may return wrong IDENTITY value. To pe precise, it may return value from the record added by another user.
>
>
>>Actually, SCOPE_IDENTITY pointed me to IDENT_CURRENT.
>>
>>I added IDENT_CURRENT to my SQL class, where I pass in the table name:
>>
>>
>>** Form the query
>>sQuery = "SELECT IDENT_CURRENT('" + ALLTRIM(sTableName) + "')"
>>
>>** Run the query
>>iResult = SQLExec(.iConnHandle, sQuery, "last_id")
>>
>>** If the command completed successfully
>>IF iResult > -1
>>
>>  ** Store the results to the return value
>>  iRetVal = last_id.exp
>>	
>>  ** Close the last_id table
>>  USE IN last_id
>>
>>ELSE
>>
>>  ** Call the routine to record the error info
>>  ._GetErrorInfo()
>>
>>ENDIF
>>
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform