title: Sybase unique index and primary key
body: <p>Is possible to add a primary key in a table that already have a unique nonclustered index?</p>
  
  <p>I have a table cargo_car and i need to define cd_cargo_car as a PK. </p>
  
  <p>I tried this:</p>
  
  <pre><code>ALTER TABLE dbo.cargo_car ADD PRIMARY KEY (cd_cargo_car)
  </code></pre>
  
  <p>but i received the error:</p>
  
  <pre><code>Error (1921) An index with the same columns inthe same order alredy exists onthe table
  </code></pre>
  
  <p>This table has many dependences and when i try to drop the index I receive:</p>
  
  <pre><code>Error (3712) Cannot drop index 'cargo_car.XPKcargo_car' because it still has referential integrity constraints.
  </code></pre>
  
  <p>This is the Create script:</p>
  
  <pre><code>CREATE TABLE dbo.cargo_car
      (
      cd_cargo_car      SMALLINT NOT NULL,
      nm_cargo_car      VARCHAR (40) NOT NULL,
      cd_refini_car     CHAR (4) NOT NULL,
      cd_reffin_car     CHAR (4) NOT NULL,
      cd_jornada1_car   CHAR (2) NOT NULL,
      cd_jornada2_car   CHAR (2) NOT NULL
  
      )
  GO
  
  CREATE UNIQUE NONCLUSTERED INDEX XPKcargo_car
      ON dbo.cargo_car  (cd_cargo_car)
  GO
  </code></pre>
  
  <p>Suggestion on how to do this?</p>
  
  <p>Tks</p>