title: Running .sql file within a SQL query
body: <p>I have a SQL script I need to run on about 20 different databases.</p>
  
  <p>I basically just need to be able to run some SQL, then have it load and run a file from the disk, do more SQL, run that same script again, etc.</p>
  
  <p>I was hoping to make a SQL script that would basically look something like this:</p>
  
  <pre><code>use database1
  go
  exec c:\release.sql
  go
  
  use database2
  go
  exec c:\release.sql
  go
  
  use database3
  go
  exec c:\release.sql
  go
  </code></pre>
  
  <p>--etc....</p>
  
  <p>I've looked online a bunch and found a way to do something similar in a batch file with sqlcmd but it isn't working and I don't see how to switch databases that way, either.</p>
  
  <p>Thanks a ton!</p>
  
  <p>Ben</p>