If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > help required sql query challenge

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-15-03, 18:04
coolaryans coolaryans is offline
Registered User
 
Join Date: Sep 2003
Posts: 1
help required sql query challenge

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On