Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 creating Primary Key on a table

Author  Topic 

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2010-10-10 : 18:53:14
Hi
how do I create a clustered primary key using sql on a table that has already two clustered primary keys.

Scenario
I have a table which has a clustered primary key on 2 columns
I have added a new feild to the table and want to add it to the clustered primary key

when Iam trying to use a script it fails.Please advise

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-10 : 20:23:29
need to drop the PK then recreate it
Go to Top of Page

jim_jim
Constraint Violating Yak Guru

306 Posts

Posted - 2010-10-11 : 11:54:53
Thank you
Did drop the existing keys and then recreated the keys including the new one
Go to Top of Page
   

- Advertisement -