select * from tb
select @@rowcount两句放在一起执行

解决方案 »

  1.   

    select count(*)
    from table
      

  2.   

    @@ROWCOUNT
    返回受上一语句影响的行数。
      

  3.   

    select @@rowcount
    ---------------
    @@ROWCOUNT
    返回受上一语句影响的行数。语法
    @@ROWCOUNT返回类型
    integer注释
    任何不返回行的语句将这一变量设置为 0 ,如 IF 语句。示例
    下面的示例执行 UPDATE 语句并用 @@ROWCOUNT 来检测是否有发生更改的行。UPDATE authors SET au_lname = 'Jones'
    WHERE au_id = '999-888-7777'
    IF @@ROWCOUNT = 0
       print 'Warning: No rows were updated'
      

  4.   

    select * from 表
    select @@rowcount