title: Accessing SQL Server from Batch File - not connecting
body: <p>I am attempting to execute queries to a SQL Server from a batch file. At a later date, I will be using the batch file to send parameters to these queries, but for now, I am just trying to use a batch file to execute. </p>
  
  <p>The batch file looks like this:</p>
  
  <pre><code>sqlcmd -S "servername"\"dbname" -i "query.sql" 
  </code></pre>
  
  <p>And the error message I am getting is this:</p>
  
  <blockquote>
    <p>Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : SQL Server Network Inte
    rfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. .
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.
    Sqlcmd: Error: Microsoft SQL Server Native Client 11.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..</p>
  </blockquote>
  
  <p>I am certain that I have the instance name of the server correct, and I know that the server has remote connection enabled. My machine is on the same network as the server, and the server responds when I query it through SSMS. I have tried connecting with my admin username and password, but that makes no difference. </p>
  
  <p>Edit: As RBarryYoung pointed out, I confused instance names with database names.</p>