June 18, 2011

To Get all tables with record count in SQL Server

You can access all tables of a database by using below query.

SELECT OBJECT_NAME(id),rowcnt FROM SYSINDEXES
WHERE
OBJECTPROPERTY(id,’isUserTable’)=1 AND indid < 2

No comments:

Post a Comment