title: azure db drop pk and add a new one
body: <p>I have MS SQL database on Azure , and I want to drop my Primary key constraint and add another column as a primary key ,  every time I try to run the script to drop the primary key I get the error:</p>
  
  <p>" Tables without a clustered index are not supported in this version of SQL Server. Please create a clustered index and try again."</p>
  
  <p>by running this script:</p>
  
  <pre><code>IF EXISTS (SELECT * FROM sys.key_constraints WHERE type = 'PK' AND parent_object_id = OBJECT_ID('dbo.Paypaltransaction') AND Name = 'PK_PaypalTransaction')
     ALTER TABLE dbo.PaypalTransaction
     DROP CONSTRAINT PK_PaypalTransaction
  GO
  </code></pre>
  
  <p>Then I go and try to create another primary key :</p>
  
  <pre><code>-- add new primary key constraint on new column   
  ALTER TABLE dbo.PaypalTransaction 
  ADD CONSTRAINT PK_PaypalTransactionId
  PRIMARY KEY CLUSTERED (PaypalTransactionId)
  GO
  </code></pre>
  
  <p>and I get this error:
  "Table 'PaypalTransaction' already has a primary key defined on it."</p>
  
  <p>I understand the error's , but I can't delete the primary key because it appearently has to have one , and I can't add a new one because  I already have one .  Am I just stuck forever and ever and ever with the wrong column as my primary key :'(</p>
  
  <p>I see <a href="https://stackoverflow.com/questions/23432187/problems-changing-pk-datatype-using-entityframework-codefirst-migrations-on-azur">This Question here that is the same </a> and they ended up dropping the table and creating a new one - no way that is the only way to do this , that is just silly.</p>