title: Cannot insert duplicate key SQL
body: <pre><code>insert into A (id,Name)
  select ti.id,ti .Name 
  from A ti 
  where ti.id &gt;= 1 AND ti.id&lt;=3
  </code></pre>
  
  <p><code>id</code> is the primary key but not autogenerated. When I run the query I get an error</p>
  
  <blockquote>
    <p><em>Violation of PRIMARY KEY constraint 'XPKA'. Cannot insert duplicate key in object 'dbo.A'</em></p>
  </blockquote>
  
  <p>tabel A</p>
  
  <pre><code>id Name
  1   A
  2   B
  3   C
  </code></pre>
  
  <p>and I want to insert </p>
  
  <pre><code>id Name
  4   A
  5   B
  6   C
  </code></pre>