查询数据总条数SQL
SELECT
SUM (ROWS) [总条数]
FROM
(
SELECT
a.name,
b. ROWS
FROM
sysobjects AS a
INNER JOIN sysindexes AS b ON a.id = b.id
WHERE
(a.type = 'u')
AND (b.indid IN(0, 1))
) a;
查询空间占用情况
sp_spaceused ;
SELECT
SUM (ROWS) [总条数]
FROM
(
SELECT
a.name,
b. ROWS
FROM
sysobjects AS a
INNER JOIN sysindexes AS b ON a.id = b.id
WHERE
(a.type = 'u')
AND (b.indid IN(0, 1))
) a;
sp_spaceused ;