Information générale
Forum:
Microsoft SQL Server
No, I'll try and explain.
Say I put an address in an address table. The primary key value for that record will be generated automatically by sql server when I insert the other values.
Next I want to add some personal details to say a person table. One of those details will be a foreign key value for the record in the address table.
This will be the value that was automatically generated when I inserted my record into the address table.
So to get the foreign key value for the address I'll have to go back and read it from the address table.
How can I be sure that the I am reading the correct record? I could go to the bottom of the address table but what if someone else was adding details, via another asp form, at the same time.
In short..
If I add a record to a table.
How can I get the primary key value of the record that I added and be absolutely sure that it is correct?
Hope this is a better explaination.
Phil.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement