Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to select data

Author  Topic 

annas
Starting Member

36 Posts

Posted - 2008-03-11 : 12:50:02
Haii...

How to select the last data inserted or the new data inserted
using sql quiries..

Thank U

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-11 : 12:54:22
Are you trying to get data inside some trigger? If yes, use SELECT * FROM INSERTED to hget it. If not, use audit columns to achieve this if you have one (datemodified,datecreated,...)

else:-

SELECT * FROM Table where PKCol=(SELECT MAX(PKCol) FROM Table)

where PKCol is primary key which is of IDENTITY type
Go to Top of Page
   

- Advertisement -