title: Insufficient memory to continue the execution of the program in SQL Server 2008 R2
body: <p><a href="https://i.stack.imgur.com/UdObC.png" rel="nofollow noreferrer">SQL Server 2008 R2 warning when tried to execute the script of size approx 500MB</a></p>
  
  <p>When I tried executing a SQL script which was of 500 mb approx. Management Studio throws an error </p>
  
  <blockquote>
    <p>Insufficient memory to continue the execution of the program</p>
  </blockquote>
  
  <p>My system memory is 8GB and only 3GB is free. I tried SQLCMD but it's not working. Any other solution for this? </p>
  
  <p>I faced this issue when I was trying to restore a database using backup of higher version (SQL Server 2014) to a lower version (SQL Server 2008 R2) using scripting method.</p>