1、我想在插入数据记录的时候,同时把这个条记录的自增ID取出,
笨方法是
////////////////////////////////////////////////////////
insert into table_a (xxx) values (xxxx)
select @@identity2.没有太好的办法
笨方法是
////////////////////////////////////////////////////////
insert into table_a (xxx) values (xxxx)
select @@identity2.没有太好的办法
1.declare @id int
insert into table_a (xxx) values (xxxx)
Select @id = max(id) From table_a
2.if not exists (select * from table_b)
begin
delete From table_a
end