none
触发器的INSTER RRS feed

  • 问题

  • CREATE TRIGGER [add_total]
       ON  [dbo].[valid_mileage]
       AFTER insert
    AS SET NOCOUNT ON
    declare @valid_mileage float,@card_number nchar(10)
    select @valid_mileage=mileage from inserted
    select @card_number=card_number from inserted
    BEGIN
     update total_mileage
        set total_mileage1=total_mileage1+@valid_mileage
        where @card_number=card_number
    END

    触发器如上建立, 但是当我的触发器写好以后,SQL2005 显示我不能在valid_mileage表中添加任何的新信息
    2009年12月7日 10:04

答案

全部回复