CREATE TRIGGER CheckSessionStatus_DELETE
ON [Session]
FOR DELETE
AS
if DateDiff(minute, DateAdd(minute, 20, [Session].CreateTime), getdate()) > 0
delete from [Session] where ID=(select ID from deleted)
------解决方案--------------------
- SQL code
delete from [Session] where ID in (select ID from deleted)
------解决方案--------------------
- SQL code
CREATE TRIGGER CheckSessionStatus_DELETEON [Session]FOR DELETEASdelete from [Session] where DateDiff(minute, DateAdd(minute, 20, [Session].CreateTime), getdate()) > 0and ID in(select ID from deleted)