title: how to add primary key column with auto increment in sql server
body: <p>i have one existing table in that i need to add primary column with auto increment(1,1). how to write query for to insert one primary key column with identity(1,1). getting error - </p>
  
  <blockquote>
    <p>"Incorrect syntax near the keyword 'IDENTITY".</p>
  </blockquote>
  
  <pre><code>table ALTER TABLE OLTMS_0B8DF2
          ADD PRIMARY KEY (ID);
  </code></pre>
  
  <p>i tried like this</p>
  
  <pre><code>ALTER TABLE OLTMS_0B8DF2
  ADD PRIMARY KEY (ID) int IDENTITY(1,1);
  </code></pre>
  
  <p>getting error</p>