if not exists (select * from tablename where key=???)
    insert ...

解决方案 »

  1.   

    Select * Into #t2 from 表2
    Insert 表1 (字段) Select 字段 From 表2 Where key not in (Select key From #t2)
      

  2.   

    不用错误反馈就用
    if not exists (select * from tablename where key=???)
        insert into ...
      

  3.   

    这样子是不行的,因为如果exits就应该提示错误。条件是我是类内操作,类的接口是一个Recordset,所以,SQL语句是不可用的。