Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to get last record inserted
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Best way to get last record inserted
Miscellaneous
Thread ID:
00468348
Message ID:
00468348
Views:
48
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.
Next
Reply
Map
View

Click here to load this message in the networking platform