Difference Function

The Difference() function simply finds the difference between the two character expressions. It takes two (2) argument as text and returns an integer value ranging from 0 to 4 where 0 means No similarity, 3 means more similarity, and 4 means strong similarity or same.

The syntax for Difference function is Difference( String , String ).

SELECT Difference ('Smith', 'Smythe') /* returns 4 */ ;

SELECT Difference ('Database', 'SQL Database') /* returns 2 */ ; 

SELECT Difference ('John', 'Parker') /* returns 0 */ ; 
    

Difference and SOUNDEX functions are used to prevent duplicates and to find duplicates based on business rules, SQLDatabase.Net library also have string distance function to provide more control when testing duplicate string or numeric values.