title: insert then select scope_identity() generates duplicate rows
body: <pre><code>CREATE TABLE [schema].[table] (
    [column1] int IDENTITY NOT NULL,
    [column2] int NULL,
    [column3] int NULL,
    PRIMARY KEY CLUSTERED ([column1])
  );
  INSERT INTO schema.table (column2,column3) VALUES (1,1);
  SELECT scope_identity();
  </code></pre>
  
  <p>it inserts TWO identical rows, and returns the primary key for the second inserted row.</p>
  
  <p>It is probably a very basic reason, but google is not my friend on this one.</p>