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 are the drawbacks of using ado.net?
Explain the differences between oledb sql server, oledbdotnet provider?
What is linq and entity framework?
How does ado.net work?
How do you implement locking concept for dataset?
What does ado stand for?
What is the full form of ado.net?
What are the namespaces used in ADO.Net to connect to a database?
Explain the difference in record set and dataset?
What are the major challenges in accessing data from a database?
how can implement dropdownlist in particular of dataset when try to update?
What is the difference between executequery and executenonquery?
Define atomicity?
Which is the best method to get two values from the database?
What are the different methods by which we can populate a dataset?