This blog provides one of the ways to resolve the error “Cannot execute script: Insufficient memory to continue the execution of the program” when you are using SQL Server Management Studio.
Both of my SQL Server 2014 and SQL Server 2016 Management Studio error.
SQL Server 2014 Management Studio shows Insufficient memory to continue the execution of the program.
SQL Server 2016 Management Studio shows System.OutOfMemoryException.
There is no way to resolve this in SQL Server Management Studio.
You need to start your command prompt to run the command like below.
SQLCMD -d <database-name> -i filename.sql