0

I have hit a speed bump in debugging a system I didn't write. Every time an INSERT query is committed, after using sorting the table, the last row is always deleted (i.e. inserting C on a table of A B D E F, results to A B C D E). If the INSERT is done on the last row (i.e. inserting G on a table of A B C D E F, results to A B C D E G), it replaces the last row.

Any idea where I should try looking into? Debugging on Eclipse.

2 Answers2

0
Insert Into TableA ('CC') Values ('X');

Declare @XX char(5);

Select Top 1 @XX = CC From TableA order by CC desc;

Delete from TableA Where CC = @XX;
鄭有維
  • 265
  • 1
  • 13
0

It is hard to answer without codes. All I see is the behavior.

What are you trying to know? How to debug?

Just find all parts communicates with the database. Then look at its sql statement.

Also sql statements usually returns a value.. example an update will return how many affected rows, insert returns the new id. You can look at these values for clues. You should also make use of breakpoints in debugging mode.

aedan
  • 209
  • 4
  • 12