I am importing a cumulative report into sql server 6.5 and need to remove duplicate rows before importing into my "live" table. None of the columns have totally unique data. The live table has a combined primary key consisting of all but one of the columns in the table.

I am a novice at this so i have been trying to select into a table the results of a query that compares the temp and live table and comes up with the exceptions/uniques from the temp table.

or trying to delete from the temp table the rows that exist in the live table and then inserting the remainder, which shouldn't violate my primary key.

one of theways i've tried just selecting the unique data is like this

select * from trak_med_tmp
where not exists( select * from trak_med )

the results from this query are 0 rows. Even though the _tmp table contains all off the data from trak_med + 1 more day's worth.

Any help would be greatly appreciated.