CodePudding user response:
The select a.n ame, b.r ows
The from sysobjects a inner join sysindexes b on Anderson, d=b.i d
Where xtype='U' and b.i ndid in (0, 1)
The order by b.r ows desc
Choose your database, execute the script, it is,
CodePudding user response:
replace our table name
The EXEC sp_spaceused 'tableName'
CodePudding user response:
Select the table name=a.n ame,
Line count=b.r ows
The from sys. Tables a
The join (select object_id,
Rows=sum (rows)
The from sys. Partitions
Group by object_id) b on a.o bject_id=b.o bject_id
Where a.n ame=N 'table'