title: SQL Server Auto-Increment Next INSERT Query
body: <p>I have a good background in MySQL, but I am new to the ins and outs of SQL Server. I'll ask my question by setting up and solving the exact same issue in MySQL:</p>
  
  <hr>
  
  <p>Create table:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `example` (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `stuff` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  </code></pre>
  
  <p>Insert a value into the table:</p>
  
  <pre><code>INSERT INTO `example` (
    `id`, `stuff`
  ) VALUES (
    NULL, 'Hello World'
  ) ;
  </code></pre>
  
  <p>By executing the query above, the <code>id</code> column will automatically receive the next available integer for use as a primary key, no work involved on my part.</p>
  
  <p>However, trying the same idea when inserting a row into an SQL Server table of type <code>int</code> gives me this error:</p>
  
  <pre><code>Cannot insert the value NULL into column 'id', table 'database.user.example'; column does not allow nulls. INSERT fails. (severity 16) ...
  </code></pre>
  
  <p>What can be used in an SQL Server <code>INSERT</code> query that will automatically increment the primary key like MySQL does with a <code>NULL</code> value?</p>
  
  <p>Thank you for your time.</p>