All
How would I go about deleting rows from a table which are complete dups except for one field (one row will have a value for FileName and the other will be NULL in FileName - otherwise they are dups)? I think the below code is correct, but due to spaces, nulls, and probably some other things I haven't thought of, not all joins seem to be working. How to account for this? I have to join about 33 fields, all of which are of the nvarchar(255) data type.
delete from b from (select * from table1 where FileName is not null) a inner join (select from table1 where FileName is null) b on isnull(a.field1,0) = isnull(b.field1,0) and isnull(a.field2,0) = isnull(b.field2,0) etc.. --joining on all fields except FileName
Bonediggler