Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Alter constraints - non-clustered PK -> Clustered PK Expand / Collapse
Author
Message
Posted Wednesday, August 4, 2010 1:03 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, December 19, 2014 6:34 AM
Points: 439, Visits: 1,015
Hi all,

In SQL 2K (or SQL 2K8), is it possible to programmatically alter the PK constraints on the tables from nonclustered to clustered? When they're referenced by FKs?

Or do I have to climb all the way down the referential tree, and drop and re-create the PKs from the bottom up?

We're upgrading to SQL 2K8, and the lack of clustered indexes is becoming apparent.

Thanks!

P



Post #963766
Posted Wednesday, August 4, 2010 8:47 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:26 AM
Points: 10,381, Visits: 13,436
Don't think you can do it without dropping all the FK's and then dropping and recreating the PK and then re-adding the FK's



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #963927
Posted Thursday, August 5, 2010 5:47 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, December 19, 2014 6:34 AM
Points: 439, Visits: 1,015
Thanks Jack,

That's what I was afraid of.

Ah well, it needs doing, so....

P



Post #964165
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse