PRINT Statement [T-SQL]

Displays a message on the message window of the database server.

Quick Links:

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

PRINT format-string [, arg-list]

Examples

(back to top)

Usage

(back to top)

The PRINT statement returns a message to the client window if you are connected from an Open Client application or JDBC application. If you are connected from an Embedded SQL or ODBC application, the message displays on the database server window.

The format string can contain placeholders for the arguments in the optional argument list. These placeholders are of the form %nn!, where nn is an integer between 1 and 20.

Standards

(back to top)

  • SQL—Transact-SQL extension to ISO/ANSI SQL grammar.
  • SAP Sybase Database product—Supported by Adaptive Server.

Permissions

(back to top)

Must be connected to the database.

Related reference
MESSAGE Statement
LOGIN_PROCEDURE Option