Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is difference in record set and dataset?

989


What are two types of transaction supported by ado.net?

937


Explain the difference between data reader and data adapter?

909


What is the difference between data reader and data adapter?

963


How can we serialize the dataset object?

951


How can we perform transactions in .net?

993


What are two important objects of ADO.Net?

968


Difference between sqlcommand and sqlcommandbuilder?

1053


What is aggregate root?

998


What is the return type of executescalar?

934


Data reader read and forward only, how is it possible to get 2 tables of data at a time?

860


What is data relation in ado.net?

993


What is the difference between DataReader and DataSet in ADO.NET?

1078


What is the difference between Optimistic and Pessimistic locking?

924


Which one of the following objects is a high-level abstraction of the connection and command objects in ado.net?

1014