select  count(*)  from table

解决方案 »

  1.   

    记录很多条的时候哪个快,select top 1 * 还是 select count(*)?
    有没有更好的方法?
    我的表里记录不会很多,最多5,6千条吧。
      

  2.   

    如果只想知道是否有记录,那select top 1 *from tablename 好,
    若想知道有几条记录,用select count(字段名1) from tablename 好
      

  3.   

    if exists (select 1 from 表)
       print '有记录'
    else
       print '无记录'