hi..help with statement

  • Hi want to create primary key constraint with non clustered index.

    any one tell me the below statement works are not .

    CONSTRAINT PK_doc_metadata_doc_metadata_id PRIMARY KEY NONCLUSTERED ( column name)

  • Did you try it?

    What you have there is part of the statement, it needs ALTER TABLE <tablename> adding before.

    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
  • actually i want to know is it possible to create primary key with non_cluster index.

  • Yes.

  • sravnmaganti (8/2/2011)


    actually i want to know is it possible to create primary key with non_cluster index.

    Yes.

    Edit: man, you are fast

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • PaulB-TheOneAndOnly (8/2/2011)


    sravnmaganti (8/2/2011)


    actually i want to know is it possible to create primary key with non_cluster index.

    Yes.

    Edit: man, you are fast

    I know, and it's about time you realized it too :-D.

    THAT'S A JOKE!

  • Ninja's_RGR'us (8/2/2011)


    PaulB-TheOneAndOnly (8/2/2011)


    sravnmaganti (8/2/2011)


    actually i want to know is it possible to create primary key with non_cluster index.

    Yes.

    Edit: man, you are fast

    I know, and it's about time you realized it too :-D.

    THAT'S A JOKE!

    😀 you made my day.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • HTH 😛

Viewing 8 posts - 1 through 7 (of 7 total)

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