Can we implement Clustered Index on Unique key ?

  • Hi,

    Can we implement Clustered Index on Unique key ? If no... why ?

    Regards,

    Sachin.

  • Yes.

  • I think no...because clustered index only follow primay key.

    Expect answer from other more.....

  • Yes, you absolutely can. You can have clustered unique constraints, clustered normal indexes, nonclustered primary keys. There's nothing requiring the cluster to be on the primary key.

    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
  • thanks a lot...

  • Hi,

    How many nonclustered index we can implement on one column like "id" as per my below given table structure.

    My table structure is : -

    field datatype

    ---------------------

    id int

    name1varchar

    name2varchar

    ------------------------

    abcd nonclustered located on PRIMARY name1

    abcde nonclustered located on PRIMARY id

    abcdef nonclustered located on PRIMARY id

    IX_ta nonclustered, unique, unique key located on PRIMARYid

    PK_ta clustered, unique, primary key located on PRIMARYid

  • Hi Gail Shaw ,

    Expect answer from your side.

    Thanks in advance.

  • kumar.sachu08 (1/5/2012)


    ...How many nonclustered index we can implement on one column like "id" ...

    Why would you want more than one index on the same column?


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • kumar.sachu08 (1/5/2012)


    How many nonclustered index we can implement on one column like "id" as per my below given table structure.

    249 in SQL 2005. The question is, why on earth would you want to.

    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
  • I can't ask from interviewer :

    Why would you want more than one index on the same column?

    Such type of question come in mind after interview.

    Interviewer ask me simply how many non clustered index apply on one column.

  • kumar.sachu08 (1/5/2012)


    I can't ask from interviewer :

    Why would you want more than one index on the same column?

    Sure you can, and if anyone asked me such a downright silly question in an interview that would be my exact reply.

    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
  • expect reply with someone...please help me.

  • Reply to what?

    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
  • kumar.sachu08 (1/5/2012)


    I can't ask from interviewer :

    Why would you want more than one index on the same column?

    Such type of question come in mind after interview.

    Interviewer ask me simply how many non clustered index apply on one column.

    Just a PS, if you can't answer those questions and worse, can't find the answers on your own you are nowhere near ready to be a DBA.

Viewing 14 posts - 1 through 13 (of 13 total)

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