title: Execute SQL Server stored procedure from a batch file
body: <p>I'm trying to execute a SQL Server stored procedure from a batch file. At the moment, it works fine on my pc (using localhost) but I need to use it in another PC, my stored procedure uses queries with linked server and when I trying to execute my batch file I get these messages:</p>
  <blockquote>
  <p>Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [53]. .</p>
  <p>Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : Login timeout expired.</p>
  <p>Sqlcmd: Error: Microsoft SQL Server Native Client 11.0 : A network-related or instance-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 if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..</p>
  </blockquote>
  <p>Maybe I need to send also my user and password in my batch file? Currently this is what I have in my .bat:</p>
  <pre><code>sqlcmd -Q &quot;exec SP @Param= 1&quot; -SServerIP -dDATABASE -o PATHTOMYTXTINFOFILE
  </code></pre>