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 would you connect to database using .NET?
What are the disadvantages of using datalist?
What is dataset and datatable in ado.net?
Which object of ado contains datarow datacolumn collection?
Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.
What are the differences between OLEDB and SQLClient Providers?
What are all the different authentication techniques used to connect to MS SQL Server?
Define different execute methods of ADO.NET command object ?
What is ole db and odbc?
What is an ado?
Define atomicity?
What is the role of the dataset object in ado.net?
Can we create Synonymns in MS Acess,My Sql Server,Sql Server? But iam we can create in oracle!
What is basic use of data view?
What are the different layers of ado.net?