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
 Development Tools
 ASP.NET
 Query Optimization - DIFFERENCE

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-02-13 : 08:23:37
Sugumar writes "I am using the following code to return similar names using Sql 2000 sp2 and C#


1. FirstName - column of Table EMPLOYEES
2. TextBox - A Textbox that takes input

SELECT FirstName FROM EMPLOYEES WHERE DIFFERENCE(FirstName," + "'" + TextBox.Text.Trim() + "') >= 3";

The above code does not throw any errors though!

Thanking you,

Sugumar"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-13 : 09:24:32
Search for Where in @MYCSV here
http://sqlteam.com/forums/topic.asp?TOPIC_ID=55210

Madhivanan

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

Kristen
Test

22859 Posts

Posted - 2006-02-13 : 11:09:21
Try an example, using your real data, in Query Analyser first?

For example, the following two BOTH give 4:

SELECT DIFFERENCE('SMITH', 'SMITH')
SELECT DIFFERENCE('SMITH', 'SMYTHE')

whereas

SELECT DIFFERENCE('SMITH', 'BROWN')

gives 2 ...

Kristen
Go to Top of Page
   

- Advertisement -