SQL Flow Field Guide

PRINT

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

emits a message

What changes

Input
a string expression
Output or change
client message channel

Syntax at a glance

PRINT msg_str | @local_variable | string_expr

Work example

A short diagnostic message should appear in the client message channel during a lab.

Use PRINT for brief text only. Return structured data through a result set and do not log personal values.

Check your work PRINT. The message appears in the client output and is not mistaken for a query result set.

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