SQL Flow Field Guide

CONTAINSTABLE

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

ranked full-text search

What changes

Input
full-text index of a table, search condition
Output or change
rowset of KEY and RANK

Syntax at a glance

CONTAINSTABLE ( table , { column_name | ( column_list ) | * } , ' <contains_search_condition> ' [ , LANGUAGE language_term ] [ , top_n_by_rank ] )

Work example

A search result needs full-text matches with rank values for sorting.

Check the full-text catalog state and query a small fixture with a known match. Treat rank as a relative score, not a probability.

Check your work CONTAINSTABLE. The expected key appears and its rank is used only to order matching rows.

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