The first character of the code is the first character of SOUNDEX codes from different strings can be compared to see how similar the strings sound when spoken. The SOUNDEX() function returns a four-character code to evaluate the similarity of two expressions. In the first example, the standard Here is the result set. These functions help us find names that sound alike but are spelled differently, for example, ‘Stuart’ and ‘Stewart.’ Devuelve un código de cuatro caracteres (SOUNDEX) para evaluar la semejanza de dos cadenas.Returns a four-character (SOUNDEX) code to evaluate the similarity of two strings.Para ver la sintaxis de Transact-SQL para SQL Server 2014 y versiones anteriores, consulte To view Transact-SQL syntax for SQL Server 2014 and earlier, see SOUNDEX convierte una cadena alfanumérica en un código de cuatro caracteres que se basa en cómo suena la cadena cuando se pronuncia.SOUNDEX converts an alphanumeric string to a four-character code that is based on how the string sounds when spoken.El primer carácter del código es el primer carácter de The first character of the code is the first character of Los caracteres segundo a cuarto del código son números que representan las letras de la expresión.The second through fourth characters of the code are numbers that represent the letters in the expression.Las letras A, E, I, O, U, H, W e Y se omiten a menos que sean la primera letra de la cadena.The letters A, E, I, O, U, H, W, and Y are ignored unless they are the first letter of the string.Se agregan ceros al final si se necesita crear un código de cuatro caracteres.Zeroes are added at the end if necessary to produce a four-character code.Para más información sobre el código SOUNDEX, vea Se pueden comparar códigos SOUNDEX de distintas cadenas para ver la similitud de las cadenas cuando se pronuncian.SOUNDEX codes from different strings can be compared to see how similar the strings sound when spoken.La función DIFFERENCE realiza una operación SOUNDEX en dos cadenas y devuelve un entero que representa la similitud de los códigos SOUNDEX para esas cadenas.The DIFFERENCE function performs a SOUNDEX on two strings, and returns an integer that represents how similar the SOUNDEX codes are for those strings.En el nivel de compatibilidad de base de datos 110 o posterior, Después de actualizar al nivel de compatibilidad 110 o posterior, es posible que tenga que regenerar los Ãndices, los montones o las restricciones CHECK que usan la función SOUNDEX.After upgrading to compatibility level 110 or higher, you may need to rebuild the indexes, heaps, or CHECK constraints that use the SOUNDEX function.Un montón que contiene una columna computada persistida definida con SOUNDEX no puede ser consultada hasta que el montón sea reconstruido ejecutando la declaraciónA heap that contains a persisted computed column defined with SOUNDEX cannot be queried until the heap is rebuilt by running the statement Las restricciones CHECK definidas con SOUNDEX son deshabilitadas tras una actualización.CHECK constraints defined with SOUNDEX are disabled upon upgrade.Para permitir la restricción, ejecute la declaraciónLos Ãndices (incluyendo las vistas indizadas) que contienen una columna computada persistida definida con SOUNDEX no pueden ser consultados hasta que el Ãndice sea reconstruido ejecutando la declaraciónIndexes (including indexed views) that contain a persisted computed column defined with SOUNDEX cannot be queried until the index is rebuilt by running the statement El ejemplo siguiente muestra la función SOUNDEX y la función relacionada DIFFERENCE.The following example shows the SOUNDEX function and the related DIFFERENCE function.En el primer ejemplo se obtienen los valores estándar de El siguiente ejemplo muestra dos cadenas que solo difieren en las vocales.The following example shows two strings that differ only in vowels.En el ejemplo siguiente, las cadenas varÃan en las consonantes; por tanto, la diferencia obtenida es In the following example, the strings differ in consonants; therefore, the difference returned is Nivel de compatibilidad de ALTER DATABASE (Transact-SQL)
The DIFFERENCE function performs a SOUNDEX on two strings, and returns an integer that represents how similar the SOUNDEX codes are for those strings.SOUNDEX is collation sensitive. Returns a four-character (SOUNDEX) code to evaluate the similarity of two strings.To view Transact-SQL syntax for SQL Server 2014 and earlier, see SOUNDEX converts an alphanumeric string to a four-character code that is based on how the string sounds when spoken. SQL Server provides two functions that we can use to determine the similarity of words; those are the SOUNDEX and DIFFERENCE functions. We discuss each of them briefly: Using the SOUNDEX function: The SOUNDEX (string) function calculates the Soundex code for a string in SQL Server as follows: So we can use it easily in the SELECT statement and in the WHERE clause, as follows: String functions can be nested.In previous versions of SQL Server, the SOUNDEX function applied a subset of the SOUNDEX rules. The following shows the syntax of the SOUNDEX() function: Under database compatibility level 110 or higher, SQL Server applies a more complete set of the rules.After upgrading to compatibility level 110 or higher, you may need to rebuild the indexes, heaps, or CHECK constraints that use the SOUNDEX function.A heap that contains a persisted computed column defined with SOUNDEX cannot be queried until the heap is rebuilt by running the statement CHECK constraints defined with SOUNDEX are disabled upon upgrade. To enable the constraint, run the statement Indexes (including indexed views) that contain a persisted computed column defined with SOUNDEX cannot be queried until the index is rebuilt by running the statement The following example shows the SOUNDEX function and the related DIFFERENCE function. In previous versions of SQL Server SQL Server, the SOUNDEX function applied a subset of the SOUNDEX rules. Note: The SOUNDEX() converts the string to a four-character code based on how the string sounds when spoken. SQL Server includes two Soundex-related functions, SOUNDEX and DIFFERENCE ().
Valid for a Latin1_General collation.In the following example, the strings differ in consonants; therefore, the difference returned is Here is the result set.