HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

SQL Server 2012 - Insufficient memory to continue the execution of the program. (mscorlib)

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
themscorlib2012continuesqlprograminsufficientmemoryserverexecution

Problem

I have a sql file, which is up to 180 Mb. When I try to open and execute it on Microsoft SQL Server Managment Studio 2012, I am getting this error.
. What do do ? I researched on Google. And there were a few answers. One solution they say was running a C# script. Here is it . But I don't know how to run, and anyway if that script will work or not. Thanks for help.

Solution

If you need to execute sql file use sqlcmd documented in the MSDN: Run Transact-SQL Script Files Using sqlcmd

This did the trick for me:

sqlcmd -S serverName\instanceName -i script.sql  -o output.txt

Code Snippets

sqlcmd -S serverName\instanceName -i script.sql  -o output.txt

Context

StackExchange Database Administrators Q#74088, answer score: 4

Revisions (0)

No revisions yet.