title: What is the syntax for adding a row to a table that has an auto-incremented column?
body: <p>I'm new to SQL and have a question about how to insert a row into a table that has an auto-incremented column. In my script I create the table</p>
  
  <pre><code>CREATE TABLE orgs ( O_Id int NOT NULL identity(1,1), org varchar (255) NOT NULL, PRIMARY KEY (O_Id) );
  </code></pre>
  
  <p>which is supposed to look like</p>
  
  <pre><code>                   orgs
  -----------------------------------------------------
        O_Id           |            orgname
  -----------------------------------------------------
          1            |          "StackOverflow"
  -----------------------------------------------------
          2            |          "Madoff Investments"
  </code></pre>
  
  <p>However, I don't know how to insert rows into this table. W3Schools shows the syntax</p>
  
  <blockquote>
  <pre><code>INSERT INTO table_name (column1,column2,column3,...)
  VALUES (value1,value2,value3,...);
  </code></pre>
  </blockquote>
  
  <p>but I'm not sure how to use that when one of the columns is auto-incremented. I've tried</p>
  
  <pre><code>INSERT INTO orgs (O_id, orgname) VALUES (DEFAULT, 'StackOverflow');
  </code></pre>
  
  <p>but get the error</p>
  
  <blockquote>
    <p>DEFAULT or NULL are not allowed as explicit identity values.</p>
  </blockquote>
  
  <p>I've also tried overriding, </p>
  
  <pre><code>INSERT INTO orgs (O_id, orgname) VALUES (1, 'StackOverflow');
  </code></pre>
  
  <p>but get the error</p>
  
  <blockquote>
    <p>Cannot insert explicit value for identity column in table 'orgs' when
    IDENTITY_INSERT is set to OFF.</p>
  </blockquote>
  
  <p>What should I be doing?</p>