要判断一下,
if(exists(select * from customers where id = @id))
insert into......................
else
update ....................
不过可以写在存储过程里
if(exists(select * from customers where id = @id))
insert into......................
else
update ....................
不过可以写在存储过程里
if(not exists(select * from customers where id = @id))
insert into......................
else
update ....................
题目有点像加一个触发器说得不太明白,我认为:)