@@Rowcount主要是返回上次sql语句所影响的数据行数
SELECT * FROM dbo.Region AS R SELECT @@rowcount SELECT * FROM dbo.Region AS R WHERE R.Id <6 SELECT @@rowcount
--我们可以使用@@rowcount来作递归或循环 while @@rowcount>0 begin set @n=@n+1 select * from Region where id=@n end
原文:https://www.cnblogs.com/lgxlsm/p/10725302.html