Vector search in SQL Server: VECTOR_DISTANCE, VECTOR_SEARCH, and index trade-offs


 

In this article, I’ll explain how to implement vector search in SQL Server using the VECTOR_DISTANCE and VECTOR_SEARCH functions. You’ll learn how vector indexes work, when to use them, and what the key trade-offs are — including the current read-only table limitation. I’ll also cover the latest syntax changes in Azure SQL Database, where that limitation has already been lifted.

This is the third article in Greg Low’s series ‘AI text embeddings in SQL Server: everything you need to know’.

The VECTOR_DISTANCE function in SQL Server

Like how text embeddings are a representation of a location in a number space, any