<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf" -->

---
title: The Two Hybrid Searches in Microsoft SQL | daily.dev
description: Microsoft SQL supports two forms of hybrid search: combining full-text keyword search (BM25-based FREETEXTTABLE) with vector search, and dynamically switching...
canonical: https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Two Hybrid Searches in Microsoft SQL | daily.dev
og:description: Microsoft SQL supports two forms of hybrid search: combining full-text keyword search (BM25-based FREETEXTTABLE) with vector search, and dynamically switching...
og:url: https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf
og:image: https://api.daily.dev/og/posts/hhFmi7plF.png
og:image:alt: The Two Hybrid Searches in Microsoft SQL
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Two Hybrid Searches in Microsoft SQL

**[DevBlogs](https://daily.dev/sources/devblogs)** · 4 min read · 0 upvotes · 0 comments

## Summary

Microsoft SQL supports two forms of hybrid search: combining full-text keyword search (BM25-based FREETEXTTABLE) with vector search, and dynamically switching between exact kNN and approximate ANN (DiskANN-based) vector search depending on data scale. The piece covers FREETEXTTABLE() syntax, VECTOR_SEARCH() syntax, model integration via sp_invoke_external_rest_endpoint and AI_GENERATE_EMBEDDINGS, and how Reciprocal Rank Fusion combines full-text and vector rankings into a single RAG-ready retrieval pipeline inside SQL.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://devblogs.microsoft.com/azure-sql/two-hybrid-search>

## Questions this post answers

### What algorithm does FREETEXTTABLE() use to rank search results in SQL Server?

FREETEXTTABLE() ranks results using BM25 (Best Matching 25), a relevance-ranking algorithm co-developed by Stephen Robertson at Microsoft Research Cambridge starting in 1998. It applies language-aware word breaking and stemming automatically, so a query for "run" also matches "ran," "running," and "runs" without extra configuration, returning results via the ft.RANK column.

_Developers implementing relevance-ranked search in SQL Server can find deeper technical breakdowns like this on daily.dev._

### How does VECTOR_SEARCH() differ from VECTOR_DISTANCE() in SQL Server for finding similar vectors?

VECTOR_DISTANCE() performs an exact comparison and never uses a vector index, while VECTOR_SEARCH() is designed to retrieve nearest matches efficiently across large vector sets using approximate nearest-neighbor techniques backed by DiskANN. VECTOR_SEARCH() also supports iterative filtering, letting predicates participate during the search so SQL returns the requested number of relevant rows without oversampling.

_Teams comparing exact versus approximate vector search strategies can track these SQL Server patterns on daily.dev._

### How can I call an external AI model like GPT or Cohere directly from T-SQL for a RAG pipeline?

Use sp_invoke_external_rest_endpoint, introduced in Azure SQL in 2022, which gives T-SQL a native way to call REST services directly from the database for tasks like GPT-based intent detection or Cohere reranking. Credentials stay protected inside SQL, endpoint access requires explicit permissions, and Azure SQL further restricts calls to an allowlist of approved domains including Microsoft Foundry.

_Engineers building SQL-centered RAG pipelines can follow model-integration approaches like this on daily.dev._

## Similar posts on daily.dev

- [DiskANN Vector Index and Vector Search Are Now Generally Available in Azure SQL](https://daily.dev/posts/diskann-vector-index-and-vector-search-are-now-generally-available-in-azure-sql-osouki4it) · DevBlogs · 0 upvotes · 0 comments
- [Hybrid search and reranking: a deeper look at RAG](https://daily.dev/posts/hybrid-search-and-reranking-a-deeper-look-at-rag-9ibfhxn0o) · Ubuntu · 0 upvotes · 0 comments
- [Hybrid Search Explained: Combining Vector and Keyword Retrieval](https://daily.dev/posts/hybrid-search-explained-combining-vector-and-keyword-retrieval-csaektsg6) · BigData Boutique blog · 0 upvotes · 0 comments

---

Tags: [#azure](https://daily.dev/tags/azure), [#rag](https://daily.dev/tags/rag), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server), [#vector-search](https://daily.dev/tags/vector-search), [#full-text-search](https://daily.dev/tags/full-text-search)

[View this post on daily.dev](https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Two Hybrid Searches in Microsoft SQL","url":"https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf"},"datePublished":"2026-08-18T18:41:57.246Z","dateModified":"2026-09-13T21:34:43.909Z","description":"Microsoft SQL supports two forms of hybrid search: combining full-text keyword search (BM25-based FREETEXTTABLE) with vector search, and dynamically switching...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2cba30c89800b4f579b40ce634d45ba5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2cba30c89800b4f579b40ce634d45ba5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DevBlogs","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DevBlogs","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/8f68b453325f482ebeb73fb780092713","url":"https://daily.dev/sources/devblogs"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"azure,rag,microsoft-sql-server,vector-search,full-text-search","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DevBlogs","item":"https://daily.dev/sources/devblogs"},{"@type":"ListItem","position":3,"name":"The Two Hybrid Searches in Microsoft SQL"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-two-hybrid-searches-in-microsoft-sql-hhfmi7plf#faq","mainEntity":[{"@type":"Question","name":"What algorithm does FREETEXTTABLE() use to rank search results in SQL Server?","acceptedAnswer":{"@type":"Answer","text":"FREETEXTTABLE() ranks results using BM25 (Best Matching 25), a relevance-ranking algorithm co-developed by Stephen Robertson at Microsoft Research Cambridge starting in 1998. It applies language-aware word breaking and stemming automatically, so a query for \"run\" also matches \"ran,\" \"running,\" and \"runs\" without extra configuration, returning results via the ft.RANK column. Developers implementing relevance-ranked search in SQL Server can find deeper technical breakdowns like this on daily.dev."}},{"@type":"Question","name":"How does VECTOR_SEARCH() differ from VECTOR_DISTANCE() in SQL Server for finding similar vectors?","acceptedAnswer":{"@type":"Answer","text":"VECTOR_DISTANCE() performs an exact comparison and never uses a vector index, while VECTOR_SEARCH() is designed to retrieve nearest matches efficiently across large vector sets using approximate nearest-neighbor techniques backed by DiskANN. VECTOR_SEARCH() also supports iterative filtering, letting predicates participate during the search so SQL returns the requested number of relevant rows without oversampling. Teams comparing exact versus approximate vector search strategies can track these SQL Server patterns on daily.dev."}},{"@type":"Question","name":"How can I call an external AI model like GPT or Cohere directly from T-SQL for a RAG pipeline?","acceptedAnswer":{"@type":"Answer","text":"Use sp_invoke_external_rest_endpoint, introduced in Azure SQL in 2022, which gives T-SQL a native way to call REST services directly from the database for tasks like GPT-based intent detection or Cohere reranking. Credentials stay protected inside SQL, endpoint access requires explicit permissions, and Azure SQL further restricts calls to an allowlist of approved domains including Microsoft Foundry. Engineers building SQL-centered RAG pipelines can follow model-integration approaches like this on daily.dev."}}]}
```

