当前位置: 代码迷 >> Sql Server >> 统计行数的有关问题
  详细解决方案

统计行数的有关问题

热度:162   发布时间:2016-04-27 19:40:05.0
统计行数的问题
用游标insert了个表,现在要返回行数,该怎么写呢

------解决方案--------------------
create table tab(id int)
insert tab
select 1 union all
select 2 union all
select 3
select @@rowcount
drop table tab
------解决方案--------------------
用游标insert了个表,现在要返回行数,该怎么写呢
------------------

每次都是insert一条,对吧。

想返回insert了多少条,定义个变量,初始值为0,每insert一条自加1,很难?
  相关解决方案