Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Identity column
Message
From
14/10/1998 10:19:58
 
 
To
13/10/1998 18:53:34
Scott Barker
Barker Systems Consulting Ltd.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00146437
Message ID:
00146634
Views:
16
Scott,

You can use SPT to retrieve the assigned identity value. After issuing the TABLEUPDATE() use something like this:

c = CURSORGETPROP('CONNECTHANDLE', 'view_name_goes_here')
r = SQLEXEC(c, [SELECT @@IDENTITY], 'identity')

There should be a cursor that contains the new identity value. You must execute the SPT query on the same connection that the view is using. @@IDENTITY is scoped to the connection. Also, @@IDENTITY contains the value of the last identity column assigned. If your remote table has a trigger that inserts a row into another table the has a identity column, @@IDENTITY will contain the value for that table, not the table that you're manipulating.

-Mike

>Hi there
>
>How do you retrieve the unique identifier sql server assigns to the
>record you just sent in with the tableupdate() funct from a remote view? ... seeing that it was my only unique indent ... I don't know how to get it back? ...
>
>I need to show this id to the user after they have pressed save.
>
>This is probably an easy question for someone in here!
>
>Thx for any quick help you can provide!
>
>Scott
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform