触发器的使用sqlserver

create trigger OrderAds on ads for insert as begin declare @OrderId int select @OrderId=isnull(max(Order_ID),0)+1 from [Ads] update Ads set Order_ID =@OrderId where Gid=(Select Gid from Inserted) --select * from inserted end go

你可能感兴趣的:(Go)