title: Unable to login to SQL Server 2008 through command line utility
body: <p>I have installed SQL Server 2008 Management Studio and am able to login to the database through this. I have also installed the SQL command utility. But, am unable to login through the command utility. I get the following error:</p>
  
  <pre><code>C:\Users\Administrator&gt;sqlcmd
  HResult 0x274D, Level 16, State 1
  TCP Provider: No connection could be made because the target machine actively re
  fused it.
  </code></pre>
  
  <blockquote>
    <p>Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A
    network-related or in stance-specific error has occurred while
    establishing a connection to SQL Server . Server is not found or not
    accessible. Check if instance name is correct and i f SQL Server is
    configured to allow remote connections. For more information see  SQL
    Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native
    Client 10.0 : Login timeout expired.</p>
  </blockquote>
  
  <p>I tried giving the server name, username and password explicitly using:</p>
  
  <pre><code>sqlcmd -S &lt;hostname\database instance&gt; -U &lt;user&gt; -P &lt;pwd&gt;
  </code></pre>
  
  <p>this too doesn't help.</p>
  
  <p>I need this command utility for my automation stuff. Please help me!</p>