From: http://www.microsoft.com/india/msdn/articles/SQL2000BetterPractices.aspx
| SQL Server Books Online (BOL) documents the structure of sysindexes; the value of sysindexes.indid will always be 0 for a table and 1 for a clustered index. If a table doesn't have a clustered index, its entry in sysindexes will always have an indid value of 0. If a table does have a clustered index, its entry in sysindexes will always have an indid value of 1. |
| |
|
SELECT object_name(id) as tablename ,rowcnt FROM sysindexes WHERE indid IN (1,0) AND OBJECTPROPERTY(id, 'IsUserTable') = 1 order by tablename
|