Reputation: 432
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
Reputation: 4957
We can run big scripts using command line.
Ie :
sqlcmd -S myServer\instanceName -U sqlusername -P sqlpassword -i C:\myScript.sql
Upvotes: 4
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