How to: Enable SQLCMD mode in the Transact-SQL Editor

The Transact-SQL (T-SQL) editor can support the use of many SQLCMD commands in your scripts. You can toggle whether SQLCMD commands are executed or ignored. If you execute a script that contains SQLCMD commands when SQLCMD mode is off, a syntax error results.

To toggle SQLCMD mode in the T-SQL editor

  1. Start a T-SQL editor session. For more information, see How to: Start the Transact-SQL Editor.

  2. On the Data menu, point to T-SQL Editor, and click SQLCMD Mode. You can also click SQLCMD Mode on the T-SQL Editor toolbar.

See Also

Tasks

How to: Execute a Query

Concepts

Editing SQLCMD Scripts in the Transact-SQL Editor
Query Results Overview