Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server vs. FoxPro
Message
From
08/05/2001 13:17:07
 
 
To
08/05/2001 10:14:10
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00504606
Message ID:
00504840
Views:
16
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform