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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 soundex or sounds like- function

Author  Topic 

icw
Constraint Violating Yak Guru

378 Posts

Posted - 2007-12-14 : 04:27:37
Hi All
Is there a soundex function or 'looks-like' or something similar to the soundex function in Crystal reports.
This would be really useful for my client if they want to find any records with a similar name on the database.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-12-14 : 04:30:16
Yes. SQL Server provides two functions - SOUNDEX() and DIFFERENCE() for phonetic comparison.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

icw
Constraint Violating Yak Guru

378 Posts

Posted - 2007-12-14 : 06:26:46
thanks a lot for your reply.
Don't suppose you could tell me when you would use either one.

Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-12-14 : 06:29:11
As per SQL Server help:

quote:
The SOUNDEX function converts a character string to a four-digit code for use in a comparison. Vowels are ignored in the comparison. Nonalphabetic characters are used to terminate the comparison.

The DIFFERENCE function compares the SOUNDEX values of two strings and evaluates the similarity between them, returning a value from 0 through 4, where 4 is the best match.


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-14 : 06:31:21
select soundex('sql'),soundex('sequel')


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

icw
Constraint Violating Yak Guru

378 Posts

Posted - 2007-12-14 : 06:42:56
cheers
Go to Top of Page
   

- Advertisement -