How to fetch the last inserted record in a particular table?
Answer Posted / nitin kaushik
"select @@identity"
@@identity is used to get the current transaction value .
** Note: Over a given connection if any insert statement is
executed on a table with identity column , the back end
sql-server for the connection initializes a parameter by
name "@@Identity" with the value of Identity column for the
last inserted record.
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
What is difference in record set and dataset?
What are two types of transaction supported by ado.net?
Explain the difference between data reader and data adapter?
What is the difference between data reader and data adapter?
How can we serialize the dataset object?
How can we perform transactions in .net?
What are two important objects of ADO.Net?
Difference between sqlcommand and sqlcommandbuilder?
What is aggregate root?
What is the return type of executescalar?
Data reader read and forward only, how is it possible to get 2 tables of data at a time?
What is data relation in ado.net?
What is the difference between DataReader and DataSet in ADO.NET?
What is the difference between Optimistic and Pessimistic locking?
Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?