当前位置: 代码迷 >> Sql Server >> 求数据库中表的数据行数的sql?没分了
  详细解决方案

求数据库中表的数据行数的sql?没分了

热度:193   发布时间:2016-04-27 14:05:10.0
求一个求数据库中表的数据行数的sql?急,没分了
use pubs

select name from sysobjects where type='U'

得到数据
titleauthor
stores
sales
roysched
discounts
jobs
pub_info
employee
authors
publishers
titles

我想得到它们的实际数据条数



titleauthor 35
stores 40
sales 88
roysched
discounts
jobs
pub_info
employee
authors
publishers
titles


------解决方案--------------------
SQL code
SELECT     a.name AS 表名,    b.rows  AS AS 记录数from sysobjects  AS a    INNER JOIN sysindexes AS b ON a.ID=b.id AND b.indid<2where a.type='U''
  相关解决方案