要判断一下,
if(exists(select * from customers where id = @id))
   insert into......................
else
   update ....................
不过可以写在存储过程里