如何判断一个表中,是否存在一个ID,如果存在不处理,如果不存在,插入值

if not  exists(select * from table where id=@id) 
  insert into table(id)values(@id)

相关文章: