create proc xxxId(@out_next_xxxId char(4) output)
as
begin
declare @temp int
if( (select count(*)from 表名)=0)
begin
set @out_next_xxxId='F100'
end
else
begin
select @out_next_xxxId=max(字段名)
from 表名
set @temp = right(@out_next_xxxId,3)+1
set @out_next_xxxId='C'+ cast (@temp as varchar(3))
end
end