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 > Cursor limits

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-02, 08:10
RobG RobG is offline
Registered User
 
Join Date: Nov 2002
Posts: 1
Cursor limits

Is there a limit to the number of rows a cursor can handle? I have selected approx 53000 rows into a cursor, which runs fine until it gets to about 32700 rows in. It then seems to hang - any ideas as to why this is and how I can get round it? I'm running SQL Server 2000.

DECLARE
@my_num int,
@my_unk_text_id int

SELECT @my_unk_text_id = text_id FROM st_cd WHERE feanme='UNKNOWN' and featyp='ST'

DECLARE renum CURSOR FOR SELECT text_id FROM test WHERE text_id=@my_unk_text_id
BEGIN
SET @my_num=0
OPEN renum
FETCH NEXT FROM renum
WHILE @@FETCH_STATUS = 0
BEGIN
SET @my_num = @my_num+1
UPDATE test SET text_id=text_id + @my_num where CURRENT OF renum
FETCH NEXT FROM renum
END
CLOSE renum
DEALLOCATE renum
END
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