tag:blogger.com,1999:blog-495177919198719500.post4090866004618171617..comments2023-12-27T20:52:29.483-08:00Comments on Microsoft Sql Server Tutorials: Identify Tables that have Clustered index but no NonClustered indexesSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-495177919198719500.post-36099573945394327682011-01-10T10:09:38.444-08:002011-01-10T10:09:38.444-08:00select name from sys.tables WHERE OBJECTPROPERTYE...select name from sys.tables WHERE OBJECTPROPERTYEX(object_id,'TableHasclustIndex')=1 AND OBJECTPROPERTYEX(object_id,'TableHasNonclustIndex')=0Srininoreply@blogger.comtag:blogger.com,1999:blog-495177919198719500.post-32767094010239991822010-02-26T04:49:25.326-08:002010-02-26T04:49:25.326-08:00Thanks Bob. Yes I missed out on that one and thank...Thanks Bob. Yes I missed out on that one and thanks so much for your suggestion. I have added that to the querySuprotim Agarwalhttps://www.blogger.com/profile/08349831623922214390noreply@blogger.comtag:blogger.com,1999:blog-495177919198719500.post-33324967014749536392010-02-25T10:32:03.796-08:002010-02-25T10:32:03.796-08:00I think you need to add the following filter to en...I think you need to add the following filter to ensure that the results only include tables with clustered indexes.<br /><br />AND idx.INDEX_ID = 1<br /><br />Otherwise, the query includes tables that don't have a clustered index (INDEX_ID = 0 uses a heap).Bob S.noreply@blogger.com