Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server vs. FoxPro
Message
De
08/05/2001 13:17:07
 
 
À
08/05/2001 10:14:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00504606
Message ID:
00504840
Vues:
15
>>The best way to generate automatic primary key values is to use auto-increment integer key fields. You can get ID value using "SELECT @@IDENTITY" query to SQL Server.
>
>I wouldn't say thats the best way, what if your INSERT triggers another INSERT somewhere else? Now the @@IDENTITY will be the key of another table, not the one you expected.

So how would one handle that situation Mike? I was reading about @@IDENTITY in "Inside SQL Server" just the other day and felt that there were some "dicey" situations possible, but the book made no mention of needing much care for particular situations so I *assumed* that it must be a non-issue (the only issue they really mentioned was that IDENTITY values could have gaps in numbering). My guess is that naming the table in the indentity select would be the way around it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform