Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to get last record inserted
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Best way to get last record inserted
Divers
Thread ID:
00468348
Message ID:
00468348
Vues:
47
If table has int column that is primary key identity with increment of 1 is this the best (fastest) way to get at what the key value is so I can do an update on it after creating it as a copy of another record, except for the key of course.

This is a web hit so I know no one else is adding records between my insert of this record and my update of it.

select top 1 id from T1 order by id desc

Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform