sql server - Stopping an SQL Cursor with one of two conditions -


i have cursor want stop running based on 1 of 2 conditions.
1 based on data of table, , other based on fetch status.
right cursor ignores both , keeps running.

this part of have:

open demandcur fetch next demandcur     @....,     @++++   while @index  > 0 or  @@fetch_status = 0   begin  select  ....,  ++++ from......  --after doing stuff here---  fetch next demandcur      @....,     @++++  end close demandcur deallocate demandcur 

should not and, , not or? if of conditions true, query keep running. , in case @@fetch_status true, until end


Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -