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 executequery and executenonquery?
Which is faster datareader or dataadapter?
What is data relation in ado.net?
What are the differences between OLEDB and SQLClient Providers?
What is ado or jdbc?
List all the steps in order, to access a database through ado.net?
Which is the best method to get two values from the database?
What is difference in record set and dataset?
What is difference between entity framework and ado.net?
Why is ADO.NET serialization slower than ADO ?
What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?
Explain advantages of ado.net?
What is acid in ado.net?
What is ado.net and its features?
how Sequence to connect and retrieve data from database using dataset?