SQL Flow Field Guide

DBCC CLEANTABLE

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

DBCC CLEANTABLE: administrative check or maintenance

What changes

Input
database, table, index, cache or server state named in the command
Output or change
messages or result sets; maintenance forms change storage, caches or metadata

Syntax at a glance

DBCC CLEANTABLE ( { database_name | database_id | 0 } , { table_name | table_id | view_name | view_id } [ , batch_size ] ) [ WITH NO_INFOMSGS ]

Work example

A table with dropped variable-length columns may reclaim space through a cleanup operation.

Measure the table, plan I/O and logging, and schedule the cleanup after the schema change.

Check your work The operation completes within its window and the table retains the expected rows.

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