当前位置: 代码迷 >> Sql Server >> 请教小弟我的触发器如何编译不过?总是提示说“无法绑定由多个部分组成的标识符 "Session.CreateTime"”
  详细解决方案

请教小弟我的触发器如何编译不过?总是提示说“无法绑定由多个部分组成的标识符 "Session.CreateTime"”

热度:83   发布时间:2016-04-27 19:18:05.0
请问我的触发器怎么编译不过?总是提示说“无法绑定由多个部分组成的标识符 "Session.CreateTime"”
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)
  相关解决方案