title: Can't access sqlcmd using username password
body: <p>I am new to SQL Server. Please help me to fix.</p>
  
  <p>I have created a user with password in SQL Server Management Studio (2008 R2). When I use <code>sqlcmd</code> with this user, sqlcmd says</p>
  
  <pre><code>C:\Console2&gt;sqlcmd -U admin
  Password: 
  </code></pre>
  
  <blockquote>
    <p>Msg 18456, Level 14, State 1, Server machinename, Line 1<br>
    Login failed for user 'admin'.</p>
  </blockquote>
  
  <p>I can access the server with this user using SQL Server Management Studio.</p>
  
  <p>P.S</p>
  
  <ul>
  <li>I have two instance of SQL Server Management Studio (2008 R2 and 2012). I can access that user from both version of SQL Server Management Studio.</li>
  <li>Whenever I connect using <code>sqlcmd</code> and execute <code>select @@version</code> query, it always says 2012, even I am connecting 2008 R2's <code>sqlcmd</code>.</li>
  </ul>