你在插入时判断吗!要是有相同的IP 就不插入数据库吗!

解决方案 »

  1.   

    是不是同一个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