By Oded


2008-09-03 21:32:02 8 Comments

What is the best way to get IDENTITY of inserted row?

I know about @@IDENTITY and IDENT_CURRENT and SCOPE_IDENTITY but don't understand the pros and cons attached to each.

Can someone please explain the differences and when I should be using each?

Related Questions

Sponsored Content

47 Answered Questions

10 Answered Questions

17 Answered Questions

[SOLVED] Get top 1 row of each group

22 Answered Questions

[SOLVED] Get size of all tables in database

  • 2011-10-25 16:14:34
  • Eric
  • 1184545 View
  • 1142 Score
  • 22 Answer
  • Tags:   sql-server tsql

27 Answered Questions

11 Answered Questions

[SOLVED] SQL Server: How to Join to first row

4 Answered Questions

[SOLVED] Inserting multiple rows in a single SQL query?

37 Answered Questions

[SOLVED] How can I remove duplicate rows?

5 Answered Questions

[SOLVED] Stored procedure - return identity as output parameter or scalar

2 Answered Questions

[SOLVED] Appropriate Uses of the `IDENTITY` in TSQL

Sponsored Content