Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 2.37 KB

File metadata and controls

77 lines (55 loc) · 2.37 KB
title JARO_WINKLER_DISTANCE (Transact-SQL)
description JARO_WINKLER_DISTANCE calculates the edit distance between two strings giving preference to strings that match from the beginning for a set prefix length.
author MikeRayMSFT
ms.author mikeray
ms.reviewer abhtiwar, wiassaf, randolphwest
ms.date 11/18/2025
ms.service sql
ms.subservice t-sql
ms.topic reference
ms.custom
ignite-2025
dev_langs
TSQL
monikerRange =azuresqldb-current || =azuresqldb-mi-current || =fabric-sqldb || >=sql-server-2016

JARO_WINKLER_DISTANCE (Transact-SQL) preview

[!INCLUDE sqlserver2025-asdb-asmi-fabricsqldb]

[!INCLUDE preview]

Calculates the edit distance between two strings giving preference to strings that match from the beginning for a set prefix length.

Note

  • JARO_WINKLER_DISTANCE is currently in preview in [!INCLUDE sssql25-md].
  • JARO_WINKLER_DISTANCE is available in Azure SQL Managed Instance with the SQL Server 2025 or Always-up-to-date update policy.

Syntax

JARO_WINKLER_DISTANCE (
    character_expression
    , character_expression
)

Arguments

character_expression

An alphanumeric expression of character data. character_expression can be a constant, variable, or column. The character expression can't be of type varchar(max) or nvarchar(max).

Return value

float

Remarks

This function implements the Jaro-Winkler edit distance algorithm.

Examples

The following example compares two words and returns the JARO_WINKLER_DISTANCE value as a column, named Distance.

SELECT 'Colour' AS WordUK,
       'Color' AS WordUS,
       JARO_WINKLER_DISTANCE('Colour', 'Color') AS Distance;

Returns:

WordUK WordUS Distance
------ ------ ------------------
Colour Color  0.0333333333333333

For additional examples, see Example JARO_WINKLER_DISTANCE.

Related content