title: sqlcmd error when -S Server
body: <p>I have a quite weird situation. I'm using sqlcmd to run a script with the command:</p>
  
  <pre><code>sqlcmd -S %SName% -U %UName% -P %Pwd% -d %DbName% -I -i test.sql &gt;&gt; test_log.txt 2&gt;&amp;1
  </code></pre>
  
  <p><em>SName</em> is the IP\Instance like 10.10.10.100\MyInstance</p>
  
  <p>The content of test.sql is simply:</p>
  
  <pre><code>select @@servername
  select getdate()
  </code></pre>
  
  <p>When I run it gives me the following error:</p>
  
  <p><em>Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server :  Data source name not found and no default driver specified.</em></p>
  
  <p>***If I copy and paste the script into another machine and run it works fine.</p>
  
  <p>Why is it trying to connect via ODBC? </p>
  
  <p>I believe it's an environment issue but I don't know where to start looking.</p>
  
  <p>Thanks</p>