今天终于动了动触发器
回到家小写一个简单的
ALTER TRIGGER reminder
ON userinfo
FOR INSERT
AS
declare @username varchar(10),@age int,@userid int
select @userid=userid,@age=age from userinfo
if(@age=23)
begin
insert into detailinfo(userid,age,address,tel) values(@userid,@age,'河南信阳',@age)
end
else
begin
insert into detailinfo(userid,age,address,tel) values(@userid,@age,'上海',@age)
end