Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, September 15, 2016 5:07 AM
Points: 507, Visits: 1,251
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: Today @ 2:43 PM
Points: 10,793, Visits: 14,747
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
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

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
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, September 15, 2016 5:07 AM
Points: 507, Visits: 1,251
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