SQL Flow Field Guide

TABLESAMPLE

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

page-level random sample (SYSTEM), REPEATABLE seed optional

What changes

Input
a base table
Output or change
a random subset of pages

Syntax at a glance

TABLESAMPLE [ SYSTEM ] ( sample_number [ PERCENT | ROWS ] ) [ REPEATABLE ( repeat_seed ) ]

Work example

A quick analysis needs a page-level sample of a large table and does not require an exact count.

Compare different seeds and check how page sampling differs from a row-level random sample.

Check your work TABLESAMPLE. The result is treated as an approximate page sample and is not used to prove a full-table count.

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