title: SQLCMD error: Incorrect syntax near '-'
body: <p>I am trying to connect to a local sql express Database using the following command:</p>
  
  <pre><code>sqlcmd -S SERVER2008OS-DB\SQLEXPRESS -U XXXXX-P XXXXX
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1<br>
    Incorrect syntax near '-'.</p>
  </blockquote>
  
  <p>My guess is that it is because our server has a '-' sign in its name,
  What will be the correct syntax to overcome this issue?</p>
  
  <p>Thanks alot</p>