Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
JasonJanofsky
Starting Member
5 Posts |
Posted - 2007-02-23 : 12:15:22
|
| Hey there,I am looking for a hint as to what to search for or what to read regarding finding possible duplicate data in my DB.Consider the following table:ID Name---- -------------1 Joes Pest Service2 Alabama Rock Supply3 Joe's Pest ServicesObviously, records 1 and 3 are unique data to SQL, but in our business rules I would like to do some kind of magic that will return records 1 and 3 so that a user might decide how to correct the duplicate error.It seems like I need some kind of google search within my DB to come back with a percentage match? Oh well, any help I can get I appreciate. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-02-23 : 12:43:16
|
| [code]declare @t table( [ID] int, [Name] varchar(100))insert @tselect 1, 'Joes Pest Service' union allselect 2, 'Alabama Rock Supply' union allselect 3, 'Joe''s Pest Services'select t1.[ID], t1.[name]from @t t1 cross join @t t2where t1.[id] <> t2.[id]and difference(t1.[name], t2.[name]) > 0[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|