TSQL Cursor new record added

前端 未结 3 1058
闹比i
闹比i 2021-01-19 12:25

I have written a cursor:

DECLARE CURSOR_SendMail CURSOR FAST_FORWARD  
FOR  
SELECT AlertId,AlertDetailsId,AlertDescription  
,AlertTarget,ProjectDetailId,Su         


        
3条回答
  •  攒了一身酷
    2021-01-19 13:11

    Look at the documentation for DECLARE CURSOR. There are options you can specify so that you get the behaviour you want - which you haven't told us.

    If you don't want to consider new records, consider specifying STATIC or KEYSET. If you do want to consider new records, specify DYNAMIC.

    I can't actually remember what the default behaviour is - and can't seem to find it at the moment. If I needed specific behaviour, I'd always specify it rather than rely on the default.

提交回复
热议问题