I'm trying to find out which tables in my DB don't have an index. Is there a select statment I can run that will give me a list of tables without indexes?
This should give you the name of all tables without indexes (excluding statistics-generated automatic indexes):
Select o.Name
FROM SysObjects o
LEFT JOIN (select id, indid from sysindexes
WHERE name not like '_WA%'
AND indid Not In (0,255)
) ix
ON o.id = ix.id
WHERE o.xtype = 'U'
AND ix.id is null
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.