Login to SQL Server from command line I am trying to access a SQL Server 2014 database from cmd. I am using the literal command below where the only thing I am changing is the servername:

sqlcmd [ /E ] [ /S servername ]  


However I get an error:


  Sqlcmd: '[': Unknown Option. Enter '-?' for help.


Any idea what I am doing incorrectly?
The correct syntax for Connecting to a default instance by using Windows Authentication to interactively run Transact-SQL statements

sqlcmd -S &lt;ComputerName&gt;  


Connecting to a named instance by using Windows Authentication to interactively run Transact-SQL statements:

sqlcmd -S &lt;ComputerName&gt;\&lt;InstanceName&gt;  


Connecting to a named instance by using Windows Authentication and specifying input and output files:

sqlcmd -S &lt;ComputerName&gt;\&lt;InstanceName&gt; -i &lt;MyScript.sql&gt; -o &lt;MyOutput.rpt&gt;  


Connecting to the default instance on the local computer by using Windows Authentication, executing a query, and having sqlcmd remain running after the query has finished running:

sqlcmd -q "SELECT * FROM AdventureWorks2012.Person.Person"