0

I have a 5GB that has 3 columns as a unique (non-clustered) index. I want to promote these three to be the new primary key (clustered). Should I drop this index before change the PK?

Also I am planning on dropping this index after I change the PK.

The types of the three fields are

field1: int
field2: int
field3: char(7) 

Update: Change the word promoting to dropping and setting

James A Mohler
  • 11,060
  • 15
  • 46
  • 72

1 Answers1

1

You cannot promote an existing index to primary key (or anything else).

You'll have to drop the unique index first, then create a new primary key constraint on those three columns (which will automatically create the primary key index)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Should I drop first then create new pk, or create new pk then drop index? – James A Mohler Jan 17 '13 at 21:25
  • 1
    @JamesMohler: doesn't really matter, I would say. I would probably drop the existing index first - just to avoid any possible unexpected side-effects of having the same rows in two indices... – marc_s Jan 17 '13 at 21:29