select count(*) from #temp1

解决方案 »

  1.   

    是啊,select count(*) from #temp1,但是这个count(*)的值如何得到?
      

  2.   

    你可以定义一个变量,比如:
    declare @iCount int
    select @iCount=count(*) from #temp1
      

  3.   

    sybase里有@@rowcount可以表示,不知道sql-server里有没有,或者想前面的老兄说的,
    declare @var int
    select @var=count(*) from #temp1然后判断不就行了!
      

  4.   

    sql server 有@@rowcount ,可以这样
    select * into #temp1 from table1
    print @@rowcount打印出的就是你要的记录数!