使用存储过程实现(MS-SQL):
create procedure Text
@ID int,
@功能 varchar(20),
@Other varhcar(50)
as
begin
if exists(select * from Tabel1 where ID=@ID and 功能=@功能)
update table1 set Other=@other where where ID=@ID and 功能=@功能
else
insert into table1(ID,功能,other) values(@ID,@功能,@Other)
end;