title: Could not open a connection to sql server
body: <p>i am running this in the command line:</p>
  
  <pre><code>sqlcmd -s .\SQLexpress
  </code></pre>
  
  <p>and the output i get is:</p>
  
  <blockquote>
    <p>HResult 0x2, Level 16, State 1<br>
    Named Pipes Provider: Could not open a connection to SQL Server [2].
    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>when i run this:</p>
  
  <pre><code>c:\Program Files (x86)\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\sqlservr.exe" -sSQLEXPRESS
  </code></pre>
  
  <p>i get: server error 17058 severity 16, state 1, could not open error log file</p>
  
  <p>however this works:</p>
  
  <pre><code>osql -S .\SQLExpress -E
  </code></pre>