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

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -