469,625 Members | 1,089 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

delete last added row -how to

hi i have a question how can i delete last added row. I have 2 tables .
source and destination . I take a 1 row from source table , do some
operation on it and save to destination table . after succesfull written I
want to delete added row from source table.. i'm using a coursors. the main
problem is : is there any function to check which row was last added. Now I
am doing it using select * from destionation where (and necessary
conditions). but if destination table will be 100000000 rows for example it
takes too much time... Is there another possibility to do it ???
please help

Marcin Wolku
wolku
Jul 23 '05 #1
2 2323
One important think both tables don't have primary key

Użytkownik "Marcin Wolku" <wo***@epf.pl> napisał w wiadomo¶ci
news:42******@news.vogel.pl...
hi i have a question how can i delete last added row. I have 2 tables .
source and destination . I take a 1 row from source table , do some
operation on it and save to destination table . after succesfull written I
want to delete added row from source table.. i'm using a coursors. the
main problem is : is there any function to check which row was last added.
Now I am doing it using select * from destionation where (and necessary
conditions). but if destination table will be 100000000 rows for example
it takes too much time... Is there another possibility to do it ???
please help

Marcin Wolku
wolku

Jul 23 '05 #2
Unless you can identify the last inserted row by some column or columns
in the table you cannot delete that row. There is no special feature
for determining the insertion order.

The most important problem you have is the lack of a primary key. Why
don't you fix this? This is a fundamental design flaw as I hope you
know.

--
David Portas
SQL Server MVP
--

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Hitesh Bhatiya | last post: by
14 posts views Thread by php newbie | last post: by
4 posts views Thread by frizzle | last post: by
3 posts views Thread by Trond | last post: by
9 posts views Thread by nnelson | last post: by
5 posts views Thread by Steve | last post: by
1 post views Thread by Swinky | last post: by
15 posts views Thread by buddhatown | last post: by
3 posts views Thread by =?Utf-8?B?S2F5xLFoYW4=?= | last post: by
13 posts views Thread by mac | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.