I wrote a cursor
DECLARE CURSOR_SendMail CURSOR FAST_FORWARD FOR SELECT AlertId,AlertDetailsId,AlertDescription ,AlertTarget,ProjectDetailId,Subject FROM tblAlert WHERE AlertId > @MaxAlertID
Here @MaxAlertID is some id, so records over this id will be mailed.
I want to ask: If you select records one by one and send by mail, whether any new record inserted in the tblAlert table, or only the records that were available when the cursor was declared, will be taken into account.
eg. When the cursor is declared, max id is present in the table 1000 and @MaxAlertID is 0. Therefore, when I start sending mail for each record from 1 and above, and I reach some kind of record 517, and several records are added to tblAlert with 1001 and 1002 therefore 1001 1002 will be considered or only up to 1000 will be considered.
Need a clue as soon as possible, thanks!
source share