declare cursorTEMP SCROLL Cursor
for select CRM_Customer.Code,PointYear from CRM_Customer Inner join CRM_CustomerPoint on CRM_Customer.Code=CRM_CustomerPoint.Code where BOSSUserCode<>'' and BOSSUserIsAllowed_App4OLJF='1'
declare @Code nvarchar(200),@PointYear int
OPEN cursorTEMP
FETCH NEXT FROM cursorTEMP INTO @Code,@PointYear
while(@@FETCH_STATUS=0)
Begin
INSERT INTO [EMSXDB].[dbo].[NBS_SyncPushToBOSS]
([Id]
,[Action]
,[Parameter1]
,[Parameter2]
,[Parameter3]
,[Parameter4]
,[Parameter5]
,[Parameter6]
,[Parameter7]
,[Parameter8]
,[Parameter9]
,[Parameter10]
,[Parameter11]
,[Parameter12]
,[Parameter13]
,[Parameter14]
,[Parameter15]
,[Parameter16]
,[Parameter17]
,[Parameter18]
,[Parameter19]
,[Parameter20]
,[IsMustSucceed]
,[Sys4CreateTime]
,[Sys4Version])
VALUES
(newid()
,'CustomerPoint_Overwrite'
,@Code
,'手动清除-'+convert(nvarchar(100),@PointYear)
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,1
,getdate()
,10)
--移动到下一条
FETCH NEXT FROM cursorTEMP INTO @Code,@PointYear
End
Close cursorTEMP
DEALLOCATE cursorTEMP