select count(*) from table

解决方案 »

  1.   

    连接!
    eg:
    create table A
    (
       id int
    )create table B
    (
       id int,
       name varchar(10)
    )insert A select 1insert B select 1,'Test'
    select A.id,B.name from A ,B where A.id=B.id
      

  2.   

    哦!看错咯!
    select count(*) from A,B where 连接的关系...
      

  3.   

    select count(*) as acount ,(select count(*) from b )as  bcount,(select count(*) from c) as ccount,...
    from a
      

  4.   

    use 数据库的名字
    exec sp_Msforeachatable
    @command1='select tablename=''?'',Records=count(*) from ?',
    @whereand='and o.name like ''%pub%''',
    @precommand='Print ''Procedd Begin''',
    @postcommand='Print ''process End'''
      

  5.   

    exec sp_Msforeachtable
    @command1='select tablename=''?'',Records=count(*) from ?',
    @whereand='and o.name like ''%s%''',    ----s为数据库中表所包含的字段,例如  表    --------------------------------------------------students 含有s字符
    @precommand='Print ''Procedd Begin''',
    @postcommand='Print ''process End'''
      

  6.   

    第一步
    create view Vcount
    as
    select 'tablename1' as '表名',count(*) as '记录数' from tablename1
    union all
    select 'tablename2' as '表名',count(*) as '记录数' from tablename2第二步
    select * from  Vcount