首页 > 技术文章 > 执行插入语句时直接返回插入信息的自增id,判断是否为空

valiant1882331 2015-10-29 13:23 原文

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 ;

推荐阅读