1、需要执行语句
declare @c int
select rid from reg where yesno=0
set @c=@@rowcount...select top 10 * from (select rid from reg where yesno=0) as a
set @c=@@rowcount2、不需要执行语句
declare @c int
select @c=count(*) from reg where yesno=0...select @c=count(*) from (
select top 10 * from (select rid from reg where yesno=0) as a
) as t
declare @c int
select rid from reg where yesno=0
set @c=@@rowcount...select top 10 * from (select rid from reg where yesno=0) as a
set @c=@@rowcount2、不需要执行语句
declare @c int
select @c=count(*) from reg where yesno=0...select @c=count(*) from (
select top 10 * from (select rid from reg where yesno=0) as a
) as t
和语句
"select top 10 * from (select rid from reg where yesno=0) as a" 加個
print @@rowcount@@rowcount取得行數
详细的可以查一下帮助
select 影响行数1=select count(*) from #1select top 10 * into #2 from (select rid from reg where yesno=0) as a
select 影响行数2=select count(*) from #2drop table #1,#2
select top 10 @d=count(*) from (select rid from reg where yesno=0) as a
select @c,@d
返回受上一语句影响的行数。
直接打印@@ROWCOUNt