• GilaMonster (3/5/2014)


    ChrisM@Work (3/5/2014)


    GilaMonster (3/5/2014)


    A column cannot be present in an index twice.

    Yes I know but...

    Not 'cannot be specified twice', actual 'cannot be present twice', so precluding SQL putting a column there a second time implicitly.

    It's worth pointing out that this feature is well hidden. If I script out the nc index containing the cluster key as an include column from the code I posted above, the cluster key column still shows in the script as an include column.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden