TSQL Cursor new record added

前端 未结 3 1060
闹比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 12:57

    To quote from the documentation:

    DYNAMIC

    Defines a cursor that reflects all data changes made to the rows in its result set as you scroll around the cursor. The data values, order, and membership of the rows can change on each fetch. The ABSOLUTE fetch option is not supported with dynamic cursors.

    So adding DYNAMIC to your cursor definition will give you what you want. Or do you need the opposite? Then make a STATIC cursor

提交回复
热议问题