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
Start a T-SQL editor session. For more information, see.
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.