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
How can we load multiple tables in to dataset?
What are three methods for displaying data in a syncfusion datagrid
What are the different layers of ado.net?
What is a datagridview?
How to aggregating data across related tables?
Which database is the ado.net sql connection object designed for?
Data reader read and forward only, how is it possible to get 2 tables of data at a time?
Can datareader hold data from multiple tables?
What two types of data providers does ADO.NET supply? What determines which one you should use?
Why edit is not possible in repeater?
Compare Data Reader & Dataset in ado.net?
Describe ado.net object model in detail.
What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?
Do you use stored procedure in ado.net?
Define the data provider classes that is supported by ado.net?