是不是同一个IP但登记的帐号不一样就不让插入,也就是说一个IP只能注册一个帐号,像传奇世界的网站一样,呵呵试试,看对不对create trigger t_test on table1 instead of insert as if exists(select 1 from table1 a,inserted i where a.ip=b.ip) delete from table1 where ip=(select ip from inserted) else insert into table1 select * from insertedgo
instead of insert
as
if exists(select 1 from table1 a,inserted i where a.ip=b.ip)
delete from table1 where ip=(select ip from inserted)
else
insert into table1 select * from insertedgo