SQL Flow Field Guide

VECTOR_SEARCH

Catalog support for SQL Server 2025 (17.x)

approximate nearest neighbor search

What changes

Input
a table's vector column (vector index), query vector, metric
Output or change
rowset of nearest rows with distance

Syntax at a glance

SELECT TOP (N) WITH APPROXIMATE column_list FROM VECTOR_SEARCH( TABLE = object [ AS source_table_alias ] , COLUMN = vector_column , SIMILAR_TO = query_vector , METRIC = { 'cosine' | 'dot' | 'euclidean' } ) [ AS result_table_alias ] [ WHERE predicate ] ORDER BY distance;

Work example

Find approximate nearest vectors with the SQL Server 2025 vector search feature.

Check the preview feature setting, index state, model dimensions, and recall on a known sample.

Check your work Approximate search can omit neighbors and preview availability can change by target environment.

Open Microsoft Learn for full syntax, permissions, and details for your version.