2

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
aszDragua
  • 31
  • 2

1 Answers1

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