SystemFrameWorkV3: delete from [DataTableCallBackEventSetting] where tablename='CustomerActionHistory' and eventname='AddNewEvent' INSERT [DataTableCallBackEventSetting] ([CallBackType],[IsSystemFrameWork],[TableName],[EventName],[CallBackEventName],[CallBackIsSystemFrameWork],[CallBackTableName],[CallBackFillFormJSON],[CallBackStrWhere],[OrderID]) VALUES ( N'SQL',0,N'CustomerActionHistory',N'AddNewEvent',N'update',0,N'CustomerInfo',N'[{"ColumnName":"NextContactDate","Value":"<$NextContactDate$>","Operator":"="},{"ColumnName":"LastActivityDate","Value":"getDate()","Operator":"="},{"ColumnName":"CustomerActionHistory","Value":"(select count(1) from CustomerActionHistory where CustomerID=<$CustomerID$>)","Operator":"="}]',N'CustomerInfo.CustomerID=''<$CustomerID$>'' AND ''<$NextContactDate.更新前的值$>'' is not null AND len(''<$NextContactDate.更新前的值$>'' )>0',1000) CRM(一定要分开执行,第1步先执行): alter table CustomerInfo add CustomerActionHistory int null CRM(一定要分开执行,第2步再执行): CREATE INDEX CustomerInfo_CustomerActionHistory ON CustomerInfo (CustomerActionHistory) update CustomerInfo set CustomerActionHistory=(select count(1) from CustomerActionHistory where CustomerID=CustomerInfo.CustomerID) ApplicationSetting: delete from [StateObject] where [UniqueKey]='SystemVersionNumber' insert into [StateObject]([UniqueKey],[StateValue],[AddDate]) values('SystemVersionNumber','"V8.2020-11-09"',GETDATE())