Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Of @@identity and surrogate keys - HELP!
Message
From
10/12/1999 09:17:17
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00301334
Message ID:
00301629
Views:
31
Charlie,

thanks - I am well aware of "key table" techniques, but am trying to use SQL identity fields and @@identity since it is more "SQL 7 Centric" if you will, rather than pulling keys "before the fact" as I do in pure VFP.

Ken

>Ken:
>
>You can create a stored procedure that generates the next available key then return it to the client with code like this:
>
>lnKey = 0
>= sqlexec(lnhandle, "{CALL spGetKey (?@lnKey)}")
>
>or
>
>What I do is get a key at the start of an application using the above code, then each time I need a new key I concatenate it with a key generated on the client. This way you save round trips to the server each time you need a new key.
>
>Charlie
Ken B. Matson
GCom2 Solutions
Previous
Reply
Map
View

Click here to load this message in the networking platform