你用SET @QQ=SELECT COUNT(*) FROM。
然后再赋值返回吧

解决方案 »

  1.   

    执行完后用
    select @@ROWCOUNT
      

  2.   

    create procedure Proc1
    @Rowcounts int
    ASselect * from yourtable
    set @RowCounts = @@RowCount
    go
      

  3.   

    create procedure Proc1
    @Rowcounts int output
    ASselect * from yourtable
    set @RowCounts = @@RowCount
    go
      

  4.   

    create procedure Proc1
    @Rowcounts int output
    ASselect @Rowcounts=count(*) from yourtable
     
    go
      

  5.   

    调用这样就行
    declare @rowcounts int
    exec Proc1 @rowcounts output
    print @rowcounts