Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding DB Tables without indexes

Status
Not open for further replies.

Dutt

Programmer
Aug 20, 2001
33
US
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?

Cheers
 
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
 
Thanks Man...works like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top