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
wolkuOne important think both tables don't have primary key
Uytkownik "Marcin Wolku" <wolku@.epf.pl> napisa w wiadomoci
news:42805b7b@.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|||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
--
No comments:
Post a Comment