How to Get the last identity value used

Answer Posted / chandramohan

scope_identity() would be the currect answer. To avoid potential problems professionals suggests this method since it returns the recently added value.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does it mean to invest in the index?

519


Can we hide the definition of a stored procedure from a use?

661


What are the properties of the transaction?

557


How will you hide an attribute? : sql server analysis services, ssas

532


What is cursors? And what are the different types of cursor?

564






How exceptions can be handled in sql server programming?

557


What is difference between index seek vs. Index scan?

632


What happens when converting big values to integers?

579


How can you know if the row fetched from cursor is still valid in underlying table?

526


What is a matrix in ssrs?

101


Explain multiserver query

565


What is the difference between commit and rollback?

515


When I delete any data from a table, does the sql server reduce the size of that table?

590


What are the disadvantages of using the stored procedures?

555


How to override dml statements with triggers?

591