Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote views, Tableupdate and identity keys
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01515107
Message ID:
01516217
Views:
41
>
>Once the tableupdate() returns true or false I no longer can send SPT that will see SCOPE_IDENTITY(). Do I need to munge up something with a candidate key generated on the front end in order to get back the pk of the record just inserted?
>
>Remember, these are remote views. I understand how to do it in SPT but the tableupdate doesn't provide a place I can see to ask for scope_identity in the same scope.
>
>TIA

No great words of wisdom, but this was the exact issue that made me decide to switch from using views to using SPT. The only "fix" we could come up with at the time (that didn't have the issue of duplicate keys) was to include an additional field, such as a GUID, do the update, then do another query based on this GUID field to retrieve the new PK value (which you already suggested). I hated that "solution". If I remember right, the issue with VFP was that the tableupdate was called in a different scope so even if you wrapped this in a transaction SCOPE_IDENTITY wouldn't return anything (since the scope in which the key was generated was no longer the current one).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform