none
how to chane my nonclustered index to clustered?

คำตอบ

  • You could try script the current index as shown below and in the resulting script change the word NONCLUSTERED to be CLUSTERED.

    As always, to be on the safe side, backup your database prior to these type of changes.

    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    27 กุมภาพันธ์ 2555 23:13
  • Hello,

    Please, could you have a look at this thread ?

    http://social.msdn.microsoft.com/Forums/en-US/sqldisasterrecovery/thread/7e3a66ab-cda9-4b8a-aba2-54aa9bf926c6 

    Don't hesitate to post again for more help or explanations.

    Please, could you tell the edition ( Express,Standard,Entreprise,...) and the version (2000,2005,2008,2008 R2 ) and the last installed service pack ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    27 กุมภาพันธ์ 2555 23:27
    ผู้ดูแล
  • Hello Gresso,

    Have a look on this discussion.

    http://stackoverflow.com/questions/2297355/change-a-primary-key-from-nonclustered-to-clustered


    Read my blog (Blog)
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you


    • แก้ไขโดย MarkwilliumBanned 28 กุมภาพันธ์ 2555 6:56
    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    28 กุมภาพันธ์ 2555 6:55
  • Hello greaso,

    Please, could you tell us whether your primary key PK_Post on table TableA is used in the creation of another index or even index in another table ( in a foreign key, you may include one or several columns used as primary keys for several other tables ) ?

    If not, it is simple, you drop your primary key and recreate it as clustered ( it can be done thru SSMS or a script.

    If yes, it is more complicated  :

    - you drop any index,constraint including PK_Post from tables which are using them

    - you drop PK_Post from TableA and recreate it as clustered ( with SSMS ) 

    - you will have to recreate every index,constraint you dropped on other tables based on your PK_Post

    It is a task which needs not to forget any step and it is better to do a backup before the beginning of the modification process ( to avoid to loose any data ).

    Don't hesitate to post again for more help or explanations.

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    28 กุมภาพันธ์ 2555 8:48
    ผู้ดูแล

ตอบทั้งหมด

  • You could try script the current index as shown below and in the resulting script change the word NONCLUSTERED to be CLUSTERED.

    As always, to be on the safe side, backup your database prior to these type of changes.

    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    27 กุมภาพันธ์ 2555 23:13
  • Hello,

    Please, could you have a look at this thread ?

    http://social.msdn.microsoft.com/Forums/en-US/sqldisasterrecovery/thread/7e3a66ab-cda9-4b8a-aba2-54aa9bf926c6 

    Don't hesitate to post again for more help or explanations.

    Please, could you tell the edition ( Express,Standard,Entreprise,...) and the version (2000,2005,2008,2008 R2 ) and the last installed service pack ?

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    27 กุมภาพันธ์ 2555 23:27
    ผู้ดูแล
  • Hello greaso,

    Please, could you tell us whether your primary key PK_Post on table TableA is used in the creation of another index or even index in another table ( in a foreign key, you may include one or several columns used as primary keys for several other tables ) ?

    If not, it is simple, you drop your primary key and recreate it as clustered ( it can be done thru SSMS or a script.

    If yes, it is more complicated  :

    - you drop any index,constraint including PK_Post from tables which are using them

    - you drop PK_Post from TableA and recreate it as clustered ( with SSMS ) 

    - you will have to recreate every index,constraint you dropped on other tables based on your PK_Post

    It is a task which needs not to forget any step and it is better to do a backup before the beginning of the modification process ( to avoid to loose any data ).

    Don't hesitate to post again for more help or explanations.

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

    • ทำเครื่องหมายเป็นคำตอบโดย greaso 28 กุมภาพันธ์ 2555 10:14
    28 กุมภาพันธ์ 2555 8:48
    ผู้ดูแล