title: Insert without duplicates
body: <p>I have a temp table called <code>T_TEMP</code> where I have 3 fields (varchar) as follow:</p>
  
  <pre><code>id, number, name.
  </code></pre>
  
  <p>I have another table called T where I have 3 fields, one with identity (it is Sql Server 2008) called id, another called number and name. Both are varchars and id is an int.</p>
  
  <p>I tried the following statement:</p>
  
  <pre><code>Insert into T (number,name) select distinct number,name from T_TEMP
  </code></pre>
  
  <p>Despite this the insert statement has inserted all the rows, even the duplicated rows. Specifically there are 42 rows with duplicated data.</p>
  
  <p>Can anyone help me with some statement to do the insert or delete the duplicate in the temp table?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p><em>Data example</em>:</p>
  
  <pre><code>ID        |         NUMBER       |   NAME
  
  ----------| -------------------- | ---------
  
  25613278  | XX111111111BB        | B2930
  
  25613279  | XX111111111BB        | G6336
  
  25613280  | XX111111111BB        | G2344
  </code></pre>