------解决方案-------------------- insert into company(id,name,address) values(0,"","") insert into department(id,companyID,name,power) values(0,@@identity,"","") insert into person(id,departMentID,name,sex) values(0,@@identity,"","") 或 declare @bh int insert into company(id,name,address) values(0,"","") select @bh=max(id) from company insert into department(id,companyID,name,power) values(0,@bh,"","") select @bh=max(id) from department insert into person(id,departMentID,name,sex) values(0,@bh,"","")