views:

83

answers:

5

Is there some kind of SQL Statement that I can used to do a search on 1 Column in my table that is similar to what I am looking for.

Like if I am looking for something to do with a "Car" but I spell it as "Kar" it must return items of "car".

Or

If I am looking for "My Company" and I spell it as "MyCompany" it must still retun "My Company".

Select * from TableName where Column Like '%company%' will return "My Company" but I need more as the user will not always know how to spell. So I need something more advanced like some small Google App or something...

+2  A: 

That feature is in the text services so if you build a full-text search index, you should be able to use the feature.

Have a look here:

http://msdn.microsoft.com/en-us/library/ms187384.aspx

http://msdn.microsoft.com/en-us/library/ms142571.aspx

Aliostad
Can you please provide me with more info or an example please, I have no idea what this is or how to do this.....
Etienne
Details at MSDN: http://msdn.microsoft.com/en-us/library/ms142571.aspx . However, I don't think you'll be satisfied with the functionality it offers. It's lacks a lot of features that real search engines has but it is still powerful in what it can do.
Merrimack
Have a look here: SOUNDEX http://msdn.microsoft.com/en-us/library/ms187384.aspx http://msdn.microsoft.com/en-us/library/ms142571.aspx
Aliostad
A: 

Another way to help you users find what they are looking for is to implement type-ahead on the search field. If the user type: "my" he will get "My Company" as a suggestion and likely go with that.

You can easily implement type ahead using jquery or other javascript libraries. Here's a list of type ahead plugins for jQuery: http://plugins.jquery.com/plugin-tags/typeahead

Merrimack
+2  A: 

This is quite an involved problem. The quick answer is to use the SQL Server soundex algorithm, but it's pretty hopeless. Try the suggestions on this SO answer. (Updated)

Noel Abrahams
A: 

No. A full text index might get you closer, depending on your requirements (what exact features are you looking for?) One option would be roll you own .NET assembly with the desired features add it (CREATE ASSEMBLY) to sql server and use that to search.

Booji Boy
+1  A: 

Read this blog post: http://googlesystem.blogspot.com/2007/04/simplified-version-of-googles-spell.html

This is something you could implement with SQL, but it's not a built in feature.

TokenMacGuy