Table A
column id,
column w,
column x,
column y,
column z,
column a,
column b,
column Timestamp
Table B
column m,
column p,
column x,
column y,
column z,
column a,
column b,
column timestamp
I use a cursor to get each of the records from table B and to fill certain columns in A
@x,@y,@z contain values from table B.
While @@Fetch_Status = 0
Begin
SET @id= (SELECT top 1 id from A where x=@x and y=@y and z=@z order by a.timestamp)
if(@id is not null)
BEGIN
UPDATE SET A.a = @a,
A.b = @b
where id= @id
/* close and deallocate Cursor Cur_LoadDate */
close Cursor
deallocate Cursor
I do not know why it would close the query analyzer and sometimes gives low resources error even though I just tried with 100 columns in each of the table with matchin x,y,z.
help appreciated,
thank you