Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I want to drop the just the Clustered Index on the Primary Key not the Primary Key itself.

Posted on 2011-02-25
4
Medium Priority
?
414 Views
Last Modified: 2012-05-11
I want to drop the just the Clustered Index on the Primary Key not the Primary Key itself.


I have read the third method on link: http://www.dbtalks.com/UploadFile/sapnabeniwal01/339/
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 34978932
you cannot drop the index for a primary key.
you cannot change a clustered index to non-clustered without dropping it

conclusion:
you have to drop the primary key (and before that, any foreign keys pointing to it),
recreate the primary key with a non-clustered index
finally recreate the foreign keys dropped before
0
 

Author Comment

by:Mr_Shaw
ID: 34978957
Is there a quick way which I can out all the foreign key which link to my primary key which I am going to drop?
0
 

Author Comment

by:Mr_Shaw
ID: 34979055
I found a link to list all foreign keys.

http://www.mssqltips.com/tip.asp?tip=1151
0
 

Author Closing Comment

by:Mr_Shaw
ID: 34979056
thanks
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question