Simple problem

xiaoxiao2021-03-05  21

1. Search all the same names in the unified field Record Select Loginid from SystemUsers Group By Loginid Having Count (Loginid)> 12. Data Trigger Application: Insert> When the data is empty (NULL) transitions to the same column Mid maximum value plus 1 Create Trigger Test_Insert

ON DBO._OA_HJXM

INSTEAD OF INSERT

AS

begin insert into _OA_HJXM (Creater, CreateTime, ShareFlag, Deleted, FlowStatus, EndFlag, SystemText, SerialNO, HJYear, ProjName, HJLevel, Memo, Unit, Member, Depart, ProjType, Photo, Number)

Select Creater, Createtime, Shareflag, Deleted, Flowstatus, Endflag, Systemtext, Serialno, HJYear, Projname, Hjlevel, Memo, Unit, Member, Depart, Projtype, Photo,

Case When NumBer is NULL

THEN (select isnull (count (*), 0) 1 from _oa_hjxm)

2.Then (SELECT ISNULL (Max (Number), 0) 1 from _oa_hjxm)

Else Number End from Inserted

end

ON DBO._OA_HJXM

INSTEAD OF INSERT

AS

begin insert into _OA_HJXM (Creater, CreateTime, ShareFlag, Deleted, FlowStatus, EndFlag, SystemText, SerialNO, HJYear, ProjName, HJLevel, Memo, Unit, Member, Depart, ProjType, Photo, Number)

Select Creater, Createtime, Shareflag, Deleted, Flowstatus, Endflag, Systemtext, Serialno, HJYear, Projname, Hjlevel, Memo, Unit, Member, Depart, Projtype, Photo,

Case When NumBer is NULL

THEN (select isnull (count (*), 0) 1 from _oa_hjxm)

2.Then (SELECT ISNULL (Max (Number), 0) 1 from _oa_hjxm)

Else Number End from Inserted

end

转载请注明原文地址:https://www.9cbs.com/read-33036.html

New Post(0)