Shortcut: Set SQLCMD mode for all new query windows in SSMS
SQLCMD mode changes how queries are executed in SQL Server Management Studio (SSMS). When using this mode, you can work with options that aren’t normally part of SQL Server T-SQL scripts.
Some installation scripts also require SQLCMD mode and will fail if it’s not enabled.
Here’s an example of running a query against 3 servers within the same script:
First we open a new query window, then on the Query menu, we choose SQLCMD Mode.
2018-11-15