Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having identity crisis!
Message
De
30/09/1999 09:55:46
 
 
À
30/09/1999 06:56:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00270941
Message ID:
00271025
Vues:
23
Hi Tom ----

Ian proposed @@IDENTITY, which is the optimal way of getting the latest ID, but that doesn't always work. Another way would be two open two connections to the table. Save on the first connection, then requery the table with the second connection and get the key that way.

>
>Thought I'd float this again as I didn't get any response yesterday.
>
>In an application, I have a SQL Server table which has an autoincrement identity column. When I create a new record in it, I also want to create a number of records in a child table using the parent's id column content as the relating column.
>
>The problem is that, when I insert the record, do the tableupdate, and requery the remote view, it doesn't always return with the correct id column from the newly created parent table record. I usually get a few child records with one id number, a few more with another, and so on...., usually ending up with only three or four numbers in the child table where there should be twenty plus (the number of records in the parent table, if this is the first iteration of the procedure).
>
>Any ideas on how to assure that I see the correct new SQL identity column entry for a freshly inserted record in the parent table?
>
>TIA!
>Tom.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform