---
title: "SqlServer统计"
author: "zheyiw"
date: "2018-08-10T13:37:12Z"
tags: []
categories: ["移动开发"]
slug: "sqlserver"
draft: false
lastmod: "2018-08-10T13:37:12Z"
id: 2428455
url: "https://zheyiw.iteye.com/blog/2428455"
---

```java

SELECT  a.name AS [table name] ,
        b.rows AS [record count]
FROM    sysobjects AS a
        INNER JOIN sysindexes AS b ON a.id = b.id
WHERE   ( a.type = 'u' )
        AND ( b.indid IN ( 0, 1 ) )
ORDER BY a.name ,
        b.rows DESC


```