SQLCMD is a command line tool used to run SQL batches on Microsoft SQL Server.
SQLCMD.EXE is a command line tool used to run SQL batches on Microsoft SQL Server. Get help by running SQLCMD -? and by searching for SQLCMD in the documentation for SQL Server Management Studio. SQLCMD is installed as a part of the Microsoft SQL Server client tools package, and completely supersedes OSQL.EXE.
In addition to command line flags, SQLCMD supports 18 special commands inside SQL files that are not a part of T-SQL syntax. SQLCMD commands aside from "GO" must be prefixed with a colon (:) and appear at the beginning of a line.
SQL Server Management Studio also supports these 18 commands if you select "SQLCMD Mode" from the "Query" menu. This disables IntelliSense.
Reference