create trigger generate_flightInformation
for update
on flightInformation
as
if update (列名)
begin
....
end

解决方案 »

  1.   

    create trigger generate_flightInformation
    after datepart(hour,getdate())=0
    on flightInformation
    as 
    ...
    这是我写的代码,但是分析说after附近发生错误。
    麻烦高手指点
    ----------------------------------------------
    create trigger generate_flightInformation on flightInformation
    after update,insert
    as你要的內容
      

  2.   

    用after 是可以的,但后面的条件是放在触发器的主体中,即as 后,
    after 是说明对何种动作触发,可以是 update,insert,delete中的一种或多种,可改为
    as
    if datepart(hour,getdate())=0
    begin
    ...
    end
    如果只是按时间不伴随动作,可用事务来实现你的功能
      

  3.   

    看来我对触发器的理解有偏差。
    其实我想在日期变更的时候,就向flightinformation表中insert一些数据。请问应该如何实现呢?是用事务还是存储过程呢?麻烦具体写一下语句,谢谢!!
      

  4.   

    其实我想在日期变更的时候,就向flightinformation表中insert一些数据
    用作业
    调度每天0点执行