l.lijith
l.lijith

Reputation: 432

Insufficient memory to continue the execution of the program in SQL Server 2008 R2

SQL Server 2008 R2 warning when tried to execute the script of size approx 500MB

When I tried executing a SQL script which was of 500 mb approx. Management Studio throws an error

Insufficient memory to continue the execution of the program

My system memory is 8GB and only 3GB is free. I tried SQLCMD but it's not working. Any other solution for this?

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.

Upvotes: 2

Views: 9118

Answers (2)

sandeep rawat
sandeep rawat

Reputation: 4957

We can run big scripts using command line.

Ie :

sqlcmd -S myServer\instanceName -U sqlusername -P sqlpassword -i C:\myScript.sql

link details

Upvotes: 4

dean
dean

Reputation: 10098

According to this:

https://technet.microsoft.com/en-us/library/ms143432(v=sql.105).aspx

the maximum batch size is 256 MB (65.536 * 4 kB).

You will have to split the script into several smaller ones.

Upvotes: 0

Related Questions