执行插入语句时直接返回插入信息的自增id,判断是否为空

insert into userinfo(UserName,UserPass,RegTime,email)values('a','b',GETDATE(),'123@qq.com');select @@IDENTITY;
select * from student;
select fid,ISNULL(fname,'为空') from student ;

原文地址:https://www.cnblogs.com/valiant1882331/p/4920215.html