title: Executing a stored proc inside a script file using the sqlcmd -i
body: <p>Need some help with script files.
  I have an SQL script file in the following format:</p>
  
  <pre><code>Begin tran
  
  insert..
  
  select..
  
  update..
  
  Commit
  exec linked_server.db1.dbo.storedproc1
  </code></pre>
  
  <p>I am calling the above script file from within a .js file in the following manner: </p>
  
  <pre><code>var sCommand = "sqlcmd -i C:\\scriptfile1"
  
  var WshShell = new ActiveXObject("WScript.Shell");
  
  var oExec = WshShell.Exec(sCommand);
  </code></pre>
  
  <p>When I run the .js file, the code between tran-commit gets executed but the storeproc1 is never called. I know for sure that the storedproc1 is not called because it has a list of insert statements that never shows up in the table.</p>