I have a temp table called T_TEMP where I have 3 fields (varchar) as follow:
id, number, name.
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.
I tried the following statement:
Insert into T (number,name) select distinct number,name from T_TEMP
Despite this the insert statement has inserted all the rows, even the duplicated rows. Specifically there are 42 rows with duplicated data.
Can anyone help me with some statement to do the insert or delete the duplicate in the temp table?
EDIT
Data example:
ID | NUMBER | NAME
----------| -------------------- | ---------
25613278 | XX111111111BB | B2930
25613279 | XX111111111BB | G6336
25613280 | XX111111111BB | G2344