write your sql statement like this : ----------------------------------------------------------- insert into table (column list) values (values list); select @@identity ----------------------------------------------------------- the @@identity is a system global viriable to save the new id value.
select max(id)+1 from table max(id) 取出当前最大的值,+1即得到 下个值
-----------------------------------------------------------
insert into table (column list) values (values list);
select @@identity
-----------------------------------------------------------
the @@identity is a system global viriable to save the new id value.
max(id) 取出当前最大的值,+1即得到 下个值