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 the difference between statement and preparedstatement interface?
Why edit is not possible in repeater?
What is ole in excel?
Define executenonquery?
What is the use of adodc?
Where is adodb dll located?
How to aggregating data across related tables?
Define partial class?
What are the benefits of using of ADO.NET in .NET 4.0?
What are the several execute methods of ado.net?
What is the difference between a datareader and a dataset?
What is serialization and de-serialization in .net? How can we serialize the dataset object?
How is it possible to get 2 tables of data at a time by using data reader?
What are the features of ado.net?
What is the role of the dataset object in ado.net?