SET FMTONLY

SET FMTONLY#

Returns only result set metadata to the client and does not access the underlying data sources, so it is a cheap way to discover the shape of a query’s result without running it. Metadata-discovery clients (such as SQL Server Management Studio, sqlcmd, and Microsoft Data API Builder) use it to probe result-set schemas.

Syntax#

SET FMTONLY { ON | OFF }  [;]

Remarks#

When ON, a SELECT returns each result set’s column metadata followed by a completion with zero rows; no rows are produced and no source query is executed. When OFF (the default), statements run normally.

Permissions#

Requires membership in the public role.

See Also#