title: Execute SQL from external file without opening it in SSMS
body: <p>I have a huge .sql file (1.5 gb). I generated it from scripting a datasbase in Sql server 2008. Now i want to run the script on another machine to create the same database with all the data, but when i try to open it, SSMS throws an out of memory exception. The machine has 8gb of ddr3 ram, so the computer can handle it. How can i run my file, copy.sql, which has the t-sql code to create my database without opening it? Something like this in a query window in SSMS:</p>
  
  <pre><code>   exec copy.sql
  </code></pre>