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 get Last inserted row in Table

Author  Topic 

ranjeetsingh_6
Posting Yak Master

125 Posts

Posted - 2007-04-18 : 01:26:33
Hi

I want to get last inserted row of a table.There are no index column and no Date Column in the table.

Ranjeet Kumar Singh

nr
SQLTeam MVY

12543 Posts

Posted - 2007-04-18 : 02:09:05
You can't without something to order it - an identity or timestamp.

You have a heap so just doing a select might get the rows back in order of insert (more likely with a single thread) but it might not.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-04-18 : 12:07:22
Do you have a primarykey column at least?


************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -