Cannot execute script: not enough memory to continue program execution

I have a 123 MB sql file that I need to execute on my local PC. But I get

Cannot execute script: Insufficient memory to continue the execution of the program 

enter image description here

How to solve this problem?

+47
sql tsql sql-server-2012
Jul 29 '13 at 7:58
source share
7 answers

use the SQLCMD command line tool, which is much more compact in memory. It is as simple as:

 SQLCMD -d <database-name> -i filename.sql 

You need valid credentials to access an instance of SQL Server or even to access a database

Taken from here .

+67
Jul 29 '13 at 9:46
source share

It can help you! See the steps below.

sqlcmd -S server_name -d database_name -i script.sql

  • Open cmd.exe as administrator.
  • Create a catalog of documents.
  • Place the SQL Script file (script.sql) in the documents folder.
  • Enter a query with sqlcmd, server name, database name, and script -file-name as shown above for the highlighted query or below the command line screen.

enter image description here

+14
Mar 30 '16 at 9:45
source share

You can also simply increase the maximum server memory value in the server properties. To change this setting, right-click the server name and select Properties> Memory tab.

I ran into this error while trying to execute a 30 MB SQL script in SSMS 2012. After increasing the value from 1024 MB to 2048 MB, I was able to run the script.

(This is the same answer I presented here )

+5
Mar 04 '14 at 10:01
source share

If I understand your problem correctly, you are trying to restore (transact sql) xyz.sql - database + schema. You can try this command that worked for me:

 SQLCMD -U sa -i xyz.sql 
+4
Jan 23 '14 at 15:44
source share

Sometimes, due to the large size of the script and data, we encounter this type of error. The server needs enough memory to execute and provide the result. We can simply increase the memory size for each request.

You just need to go to the properties of the sql server> the "Memory" tab (left)> Now set the maximum memory limit you want to add.

In addition, there is an option at the top, “Results for text,” which consume less memory compared to the “Results for grid” option, we can also go to the result in text for less memory.

+2
Oct 06 '16 at 6:19 06:19
source share

sqlcmd -S mamxxxxxmu \ sqlserverr -U sa -P x1123 -d QLDB -i D: \ qldbscript.sql

  • Open command prompt at startup as administrator

  • enter the command above

"mamxxxxxmu" - computer name "sqlserverr" - this is the server name "sa" - server username "x1123" - server password "QLDB" - this is the name of the database "D: \ qldbscript.sql" is the sql script file to execute in database

0
Nov 09 '17 at 9:15
source share

Try this step

1) Open PowerShell

2) Write this command:

 sqlcmd -S PCNAME\SQLEXPRESS -U user -P password -d databanse_name -i C:\script.sql 

3) Press Return

:-)

enter image description here

0
Nov 14 '17 at 10:06
source share



All Articles