473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

String Comparison using "Score Method"

Dear All:

I encounter one problem when I want to implement my thought. My thought
is that user want to search a record of someone but maybe user would
type wrong name or spell name wrong. I wish to compare the string which
user inputed to the database column using "Socre Method". "Score
Method" has a variable "grade" to accumulate the score. I want to
convert the string to char array, and compare the char one by one. If
the string is more accurate , the grade is more high. At last, I choose
the most higher score record to show. How to do this thought with tsql?
Could give me some tips or guide to learn? I will appreciate your
kindness, thanks.

Apr 4 '06 #1
6 4495
Sh*********@gmail.com wrote:
Dear All:

I encounter one problem when I want to implement my thought. My thought
is that user want to search a record of someone but maybe user would
type wrong name or spell name wrong. I wish to compare the string which
user inputed to the database column using "Socre Method". "Score
Method" has a variable "grade" to accumulate the score. I want to
convert the string to char array, and compare the char one by one. If
the string is more accurate , the grade is more high. At last, I choose
the most higher score record to show. How to do this thought with tsql?
Could give me some tips or guide to learn? I will appreciate your
kindness, thanks.


http://www.merriampark.com/ld.htm

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Apr 4 '06 #2
Did you try SOUNDEX or DIFFERENCE?

Apr 4 '06 #3
If you're willing to compare the input string with every entry in a
table, then something like Levenshtein distance or other forms of edit
distance will work. But it's not much use for a quick lookup. To do
that, you're better off with a hash function, which can be pre-computed
and indexed in the reference table. For example, discard "noise"
tokens, and for the remaining tokens compute their Soundex value (or
some similar function) and concatenate together.

Apr 4 '06 #4
Look up the material given here:

http://www.codeproject.com/string/dmetaphone6.asp

Apr 5 '06 #5
Hi,

there is a built in function for that which is called SOUNDEX, perhaps
you might start with this one.

HTH, jens Suessmeyer.

---
http://www.sqlserver2005.de
---

Apr 6 '06 #6
Thanks for your advise, I completed it already. Thank you.

Apr 8 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
2
by: Olaf | last post by:
I have a frameset page witch contains the myFuc() function. The function is accessed from a page in one of the frames in the frameset. An example is shown below. <input...
2
by: todd | last post by:
Hi all. I inherited this code from a contractor. It is a .NET user control that runs on the client side (ie) on machines with the framework installed. I have been mucking around to get it work...
2
by: martyn_wynne | last post by:
Hi, I have found a odd one, my submit button is not submitting on a method="get" form after using any form of DataBind? Has anyone struck this problem before? here is snipits of the code as...
2
by: Robin Tucker | last post by:
Given the need to (possibly) alter the position of various elements in a string due to localisation, is it possible to build a string using a "printf" style function, such that the source string...
3
by: Fir5tSight | last post by:
Hi All, I have an interface class defined as follows: class FileName : IComparable { public FileName(string fileName, string packageName) { // // TODO: Add constructor logic here
1
by: Jim Carlock | last post by:
Let's not argue about semantics. Let's talk about semasiology. Do specifications exist for using mixed case, upper case, lower case for the contents of the method employed? My own preferences...
4
by: =?utf-8?B?Qm9yaXMgRHXFoWVr?= | last post by:
Hello, what is the use-case of parameter "start" in string's "endswith" method? Consider the following minimal example: a = "testing" suffix="ing" a.endswith(suffix, 2) Significance of...
5
by: Curious | last post by:
I have: if (temp.Contains("Account") == true) { temp.Replace("Account", "Client"); } The "Account" is not replaced by "Client" after this operation. I used
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.