ALTER proc [dbo].[add_info]
@id int,    --编号
@info varchar(max), --需要插入的内容
@type varchar(50)    --需要插入内容的字段名称
as    
--如果id不存在,添加一个id的记录
if (select count(*) from com where id=@id)<1
begin
exec('insert into com (id) values ('+@id+')')
end
--通过id修改动态的字段(@type)的内容
exec('update com set'+ @type+'='+@info+' where id='+@id)