I've a stored procedure that select records from a table, inserts them into temporary table.
First I create a temporary table like it should be. Then I create a primary key. Every thing except Totall look fine. Then I've a cursor that update a column in which I put the current account amount for every row.
Example
Column1 Column2 Totall
...
5734.50 0.00 295597.00
295599.50 0.00 -2.50
0.00 44537.50 44534.50
1967.50 0.00 42567.00
...
where Totall = Totall + Column2 - Column1
My problem is with only one of maybe 20 servers where the stored procedure work fine except one. On that server I usually get weard results but sometime i get a correct ones. These are the rong unes.
Column1 Column2 Totall
...
5734.50 0.00 295597.00
295599.50 0.00 705680.00
0.00 44537.50 750217.00
1967.50 0.00 748249.50
...
these values are real. The "second" row get an invalid value and after that calculation are fine for next rows.
The rows that I retrive are sorted fine. From results it seams like the WHERE CURRENT OF update diferent row. Is this posible and did some service pack for SQL Server 2000 will solve this.
I've tried everyting.
Please help.
First I create a temporary table like it should be. Then I create a primary key. Every thing except Totall look fine. Then I've a cursor that update a column in which I put the current account amount for every row.
Example
Column1 Column2 Totall
...
5734.50 0.00 295597.00
295599.50 0.00 -2.50
0.00 44537.50 44534.50
1967.50 0.00 42567.00
...
where Totall = Totall + Column2 - Column1
My problem is with only one of maybe 20 servers where the stored procedure work fine except one. On that server I usually get weard results but sometime i get a correct ones. These are the rong unes.
Column1 Column2 Totall
...
5734.50 0.00 295597.00
295599.50 0.00 705680.00
0.00 44537.50 750217.00
1967.50 0.00 748249.50
...
these values are real. The "second" row get an invalid value and after that calculation are fine for next rows.
The rows that I retrive are sorted fine. From results it seams like the WHERE CURRENT OF update diferent row. Is this posible and did some service pack for SQL Server 2000 will solve this.
I've tried everyting.
Please help.