Clustered Indexes and how to find them...

  • I'm digging into Clustered Indexes versus Non-Clustered, and from what I'm understanding Clustered are the way to go (if you have the overhead etc. for them in your database). Sooooo my question is - how do I find out if my database has indexes and what kind they are? Looking at SysIndexes, I can't see anything indicating Clustered/NonClustered, and all the reading I've done says to use them but doesn't say how to find them 🙁

    Any ideas?

    Appreciate your time

    Chris

  • Hopefully you also noticed in your reading that a table may only have 1 clustered index. You can learn more about the indexes by using the INDEXPROPERTY. You can learn more about this in Books On-Line (BOL).

  • Awesome - thanks a lot Lynn, that's perfect!

    Have a great day and may the Force be with you 😀

    Chris

  • If you look in sysindexes, the clustered index is the one that has an indid of 1. Nonclustered indexes have indids between 2 and 249.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply