SQLCMD mode in SQL Server Management Studio
August 21, 2009 | In Development | No CommentsIn Microsoft SQL Server 2005, Microsoft introduced the command line tool sqlcmd to replace osql.
The SQL Server Management Studio allows you to run your scripts in ’sqlcmd mode’ in the query window. This allows you to take advantage of the syntax colour coding and variables, while developing and testing sqlcmd scripts. By default it is turned off, but you can enable it from the ‘Query’ menu for a specific query window.
One important thing to remember about using sqlcmd, is that it uses OLEDB, while Management Studio users the .NET SqlClient. It is possible, therefore, to obtain different results when the scripts are actually run with sqlcmd at the command line.