Here's what I'm trying to do: I add a record to the table. This record receives its unique ID number (identity). Then I want to use this ID in my code. How can I find out which ID number has just received a newly added record in my SQL Server database table?
Asked
Active
Viewed 371 times
2
-
2Please kindly search in SO, before asking a new question. – Win Jul 11 '17 at 21:02
1 Answers
1
Add an output parameter to your insert statement and return scope_identity(). If this isn't sufficient just search my answer, it will be in here a bunch.

KeithL
- 5,348
- 3
- 19
- 25