欢迎投稿

今日深度:

插入语句,@@IDENTITY,@@rowcount,rowcount

插入语句,@@IDENTITY,@@rowcount,rowcount


这个实例里面的表结构参见《建表,插入标识列,自动生成id》一文


use yuyongTest 


insert into student (name,info)
values('qwe','qwe');




insert into student (name,info)
values('hhh','hhh'),
      ('iii','iii'),
      ('jjj','jjj');


select * from student;
--对于包含标识列的表, @@IDENTITY总是返回标识列值的最大者
select @@IDENTITY;
delete from student where number>20
--@@rowcount;返回其紧邻的上一句SQL语句影响的行数
select @@rowcount;

www.htsjk.Com true http://www.htsjk.com/shujukunews/7161.html NewsArticle 插入语句,@@IDENTITY,@@rowcount,rowcount 这个实例里面的表结构参见《建表,插入标识列,自动生成id》一文 use yuyongTest insert into student (name,info) values('qwe','qwe'); insert into student (name,info)...
评论暂时关闭