Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Of @@identity and surrogate keys - HELP!
Message
De
10/12/1999 09:17:17
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00301334
Message ID:
00301629
Vues:
27
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform